Nginx not picking up site in sites-enabled?

后端 未结 3 1966
半阙折子戏
半阙折子戏 2021-01-29 23:05

After over 10 hours of research I have not figured out why this doesn\'t work! I am trying to move my localhost to my sites-enabled folder which is in /etc/nginx/sites-enabled/d

相关标签:
3条回答
  • 2021-01-29 23:11

    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
    
    0 讨论(0)
  • 2021-01-29 23:15

    Changing from:

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

    to

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

    fixed my issue

    0 讨论(0)
  • 2021-01-29 23:32

    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
    
    0 讨论(0)
提交回复
热议问题