nginx missing sites-available directory

后端 未结 3 1601
野趣味
野趣味 2020-12-04 04:31

I installed Nginx on Centos 6 and I am trying to set up virtual hosts. The problem I am having is that I can\'t seem to find the /etc/nginx/sites-available dire

3条回答
  •  萌比男神i
    2020-12-04 05:23

    Well, I think nginx by itself doesn't have that in its setup, because the Ubuntu-maintained package does it as a convention to imitate Debian's apache setup. You could create it yourself if you wanted to emulate the same setup.

    Create /etc/nginx/sites-available and /etc/nginx/sites-enabled and then edit the http block inside /etc/nginx/nginx.conf and add this line

    include /etc/nginx/sites-enabled/*;
    

    Of course, all the files will be inside sites-available, and you'd create a symlink for them inside sites-enabled for those you want enabled.

提交回复
热议问题