NGINX Config File Location in Ubuntu

nginx config file location ubuntu

NGINX is a powerful, light-weight web server that provides many customization options. However, if you don’t know where NGINX config file is located, you might not be able to modify its settings as per your requirements. Here’s how to find NGINX config file location in Ubuntu.


NGINX Config File Location in Ubuntu

Depending on the Linux distribution, NGINX will place its config file at different locations. In fact, it may also include several other config files.

To begin with, look for NGINX config file at:

$ sudo vim /etc/nginx/nginx.conf


If you have setup multiple domain/websites in one server, then you might find your config file at:

$ sudo vim /etc/nginx/sites-enabled/default


For example, if you have set up multiple domains (such as in your server, look for your config file at:

$ sudo vim /etc/nginx/sites-enabled/


If you cannot find NGINX config file at any of the above locations, try the following locations:

$ sudo vim /usr/local/nginx/conf/nginx.conf
$ sudo vim /usr/local/etc/nginx/nginx.conf


If you still cannot find the config file, use the locate command

$ locate nginx.conf


After you edit, save and close NGINX config file, test it with the command

$ sudo nginx -t


If there are no errors in the output, reload NGINX with the command

$ sudo service nginx reload



About Sreeram Sreenivasan

Sreeram Sreenivasan is the Founder of Ubiq, a business dashboard & reporting platform for small & medium businesses. Ubiq makes it easy to build business dashboards & reports for your business. Try it for free today!