To enable a website, you must create a symbolic link inside the /etc/nginx/sites-enabled directory pointing to the actual vhost file in /etc/nginx/sites-available . The nginx. conf file reviews the contents of the sites-enabled directory and determines which virtual host files to include.
conf /etc/nginx/sites-enabled/test.
💡 Nginx on Linux makes use of symlinks in a smart way to enable site configurations. 👉🏼 "sites-available" folder holds all your site configurations. In the "sites-enabled" folder you create symlinks to the previous folder for the sites you wish to enable.
By default on Debian systems, Nginx server blocks configuration files are stored in /etc/nginx/sites-available directory, which are enabled through symbolic links to the /etc/nginx/sites-enabled/ directory. You can name the configuration file as you like but usually it is best to use the domain name.
I had the same problem. It was because I had accidentally used a relative path with the symbolic link.
Are you sure you used full paths, e.g.:
ln -s /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/example.com.conf
Changing from:
include /etc/nginx/sites-enabled/*;
to
include /etc/nginx/sites-enabled/*.*;
fixed my issue
Include sites-available/default
in sites-enabled/default
. It requires only one line.
In sites-enabled/default
(new config version?):
It seems that the include path is relative to the file that included it
include sites-available/default;
See the include
documentation.
I believe that certain versions of nginx allows including/linking to other files purely by having a single line with the relative path to the included file. (At least that's what it looked like in some "inherited" config files I've been using, until a new nginx version broke them.)
In sites-enabled/default
(old config version?):
It seems that the include path is relative to the current file
../sites-available/default
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With