Update nginx.md

This commit is contained in:
Stefan Pejcic
2024-12-04 14:10:28 +01:00
committed by GitHub
parent 18e353e9a1
commit 823f7c0e43

View File

@@ -31,10 +31,10 @@ Navigate to *Services > Nginx Configuration*
Under the 'Actions' section click on the button:
- *Start* - `service nginx start`
- *Stop* - `service nginx stop`
- *Restart* - `service nginx restart`
- *Reload* - `service nginx reload`
- *Start* - `docker exec nginx nginx start`
- *Stop* - `docker exec nginx nginx stop`
- *Restart* - `docker exec nginx nginx restart`
- *Reload* - `docker exec nginx nginx reload`
- *Validate* - `nginx -t`
@@ -50,3 +50,99 @@ OpenPanel automatically backs up the configuration file. It runs nginx -t to val
In case of an error in the configuration, OpenPanel displays the exact issue and reverts to the previous backup file.
### nginx.conf
nginx.conf is the main configuration file located in `/etc/nginx/nginx.conf` inside nginx container.
```bash
/etc/openpanel/nginx/nginx.conf
```
![nginx main conf](/img/admin/nginx/nginx_mainconf.png)
### Default VHost Template
The default nginx configuration file (in nginx container: `/etc/nginx/sites-available/default`). This file is used for domains that are pointed to the server IP but not currently added by any OpenPanel user.
```bash
/etc/openpanel/nginx/vhosts/default.conf
```
![nginx default conf](/img/admin/nginx/nginx_defaultconf.png)
### Default Landing Page
Landing page is displayed on domains that have no website yet.
```bash
/etc/openpanel/nginx/default_page.html
```
![nginx landing](/img/admin/nginx/nginx_landing.png)
### Suspended User Template
Suspended User Template is displayed on every domain for a suspended user.
```bash
/etc/openpanel/nginx/suspended_user.html
```
![nginx suspended user](/img/admin/nginx/nginx_suspendeduser.png)
### Suspended Domain Template
Suspended Domain Template is displayed on suspended domains.
```bash
/etc/openpanel/nginx/suspended_website.html
```
![nginx suspended website](/img/admin/nginx/nginx_suspendedwebsite.png)
### Domain VHost Template
This file is copied for every new domain added by OpenPanel users.
```bash
/etc/openpanel/nginx/vhosts/domain.conf
```
![nginx domain](/img/admin/nginx/nginx_domain.png)
### Domain ModSecurity VHost Template
If ModSecurity is installed on the server, this file is copied for every new domain added by OpenPanel users.
```bash
/etc/openpanel/nginx/vhosts/domain.conf_with_modsec
```
![nginx domain modsec](/img/admin/nginx/nginx_domainmodsec.png)
### Domain ModSecurity VHost Template
If ModSecurity is installed on the server, this file is copied for every new domain added by OpenPanel users.
```bash
/etc/openpanel/nginx/vhosts/domain.conf_with_modsec
```
![nginx domain modsec](/img/admin/nginx/nginx_domainmodsec.png)
## Domain Nginx Docker VHost Template
For users with Nginx webserver, this file is copied inside their docker container for every new domain.
```bash
/etc/openpanel/nginx/vhosts/docker_nginx_domain.conf
```
![docker_nginx_domain](/img/admin/nginx/docker_nginx_domain.png)
## Domain Apache Docker VHost Template
For users with Apache webserver, this file is copied inside their docker container for every new domain.
```bash
/etc/openpanel/nginx/vhosts/docker_apache_domain.conf
```
![docker_apache_domain](/img/admin/nginx/docker_apache_domain.png)
## OpenPanel Proxy
This file affects all user domains and makes accessing services via user domains: `/openpanel` `/openadmin` `/webmail`
```bash
/etc/openpanel/nginx/vhosts/openpanel_proxy.conf
```
![openpanel_proxy](/img/admin/nginx/openpanel_proxy.png)
## OpenPanel Proxy
These error pages are shown to visitors when the domain configuration file is malformed or no response from docker container.
```bash
/etc/openpanel/nginx/vhosts/error_pages/
```
![error_pages](/img/admin/nginx/error_pages.png.png)