H
H
hesher_wise2021-09-29 13:49:30
Nginx
hesher_wise, 2021-09-29 13:49:30

Site.conf file link conflict in nginx?

Hello!
At me here such problem:
Created two sites on one IP address. I pushed their config files into /etc/nginx/sites-available/
Then I created links to these config files in /etc/nginx/sites-enabled
, did nginx -s reload and got an error
In the nginx.conf config file itself, I had it written here so
include /etc/nginx/sites-available/*.conf;
include /etc/nginx/sites-enabled/*.conf;
.
after conflict removed "include /etc/nginx/sites-enabled/*.conf;" and the conflict disappeared and the sites started working.
What have I done wrong? Why didn't the links work correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Dmitriev, 2021-09-29
@hesher_wise

This should not be in the nginx.conf config
include /etc/nginx/sites-available/*.conf;
only this
include /etc/nginx/sites-enabled/*.conf;
This is the standard approach to enable site disablement in nginx by creating and removing symlinks from /etc/nginx/sites-available/ to /etc/nginx/sites-enabled/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question