Nginx | Spiffberrypi

The file mysite_nginx.conf is created in directory /etc/nginx/sites-enabled but there's nothing in it.

You shouldn't create the mysite_nginx.conf file under this directory. You should create it under the /etc/nginx/sites-available.

Then, using this command:

sudo ln -s ~/path/to/your/mysite/mysite_nginx.conf /etc/nginx/sites-enabled/

you create a symbolic link under the /etc/nginx/sites-enabled directory. That's why, when you do a:

ls -a /etc/nginx/sites-enabled

you get an output like this (the --> refers to a symbolic link):

.... default --> /etc/nginx/sites-available/default
.... mysite_nginx.conf --> /etc/nginx/sites-available/mysite_nginx.conf

Remember, the main file (the one that has the actual data in there) is under the /etc/nginx/sites-available/ dir, whereas the /etc/nginx/sites-enabled holds only symlinks from the sites-available. That's a good practice to follow. You could, however, write the mysite_nginx.conf file, straight inside the /etc/nginx/sites-enabled but it's not recommended.

 

Scroll to Top