Skip to content

Nginx

Overview

Each site has it's nginx configuration in /etc/nginx.conf.d/ - the file will end in .conf.

Note there may also be *.conf.dist files in this directory- these are example files for specific apps (wordpress/laravel/magento etc) and are not active- by default nginx only parses .conf files. These are required and should not be removed.

Note

In general, we recommend against making manual modifications to your nginx configuration files; these are automatically generated and managed by Cito, and so unmanaged changes can have undesirable consequences.

Making configuration changes

To validate your configuration change before applying it, run nginx -t. If there's an error, nginx will warn you:

cito/etc/nginx/conf.d # nginx -t
nginx: [emerg] unknown directive "somethingwrong" in /etc/nginx/conf.d/broken.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

Or tell you the configuration is valid:

cito/etc/nginx/conf.d # nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

To reload nginx (without downtime), run systemctl reload nginx.