After making any changes, you must restart Nginx by running the following command as root:
sudo service nginx-sp restart
The easiest way to customize an app's Nginx configuration is to add new files in the directory:
/etc/nginx-sp/vhosts.d/APPNAME.d
Note that Nginx loads configuration files from the above directory in
alphabetical order. This is important to remember for Nginx directives
where order is important, such as the location
directive.
Every app starts with the following Nginx files created by ServerPilot:
/etc/nginx-sp/vhosts.d/APPNAME.conf /etc/nginx-sp/vhosts.d/APPNAME.d/main.conf
If you must modify either of these files, you must first rename the file so that ServerPilot won't overwrite your changes.
If you edit APPNAME.conf
, rename it to APPNAME.custom.conf
.
If you edit main.conf
, rename it to main.custom.conf
.
After making any changes, you must restart Nginx by running the following command as root:
sudo service nginx-sp restart
If you need to customize the Nginx main context, you can add configuration files in the directory:
/etc/nginx-sp/core.d
Any configurations added in the above directory will be loaded in the Nginx main context.
If you need to customize the Nginx http context, you can add configuration files in the directory:
/etc/nginx-sp/http.d
Any configurations added in the above directory will be loaded in the Nginx http context.
If you need to customize the Nginx events context, you can add configuration files in the directory:
/etc/nginx-sp/events.d
Any configurations added in the above directory will be loaded in the Nginx events context.