Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx not picking up site in sites-enabled?

Tags:

nginx

People also ask

How do I enable available sites in nginx?

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.

Where is sites-enabled folder nginx?

conf /etc/nginx/sites-enabled/test.

What is the difference between sites available and sites-enabled in nginx?

💡 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.

What is ETC nginx sites-enabled default?

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