NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
zouwei
V2EX  ›  NGINX

nginx 中 sites-available 下新加了一个配置文件,重启后却不起作用

  •  
  •   zouwei · Sep 30, 2017 · 6828 views
    This topic created in 3159 days ago, the information mentioned may be changed or developed.

    nginx 中 sites-available 下新加了一个配置文件,重启后却不起作用,搞了半天是忘了启用这个配置。应该再往 sites-enabled 加上这个文件的链接,这应该是个标准做法。 1、新建链接文件:touch path/to/linkdemo 2、源文件链接到 linkdemo :ln -s path/to/sourcedemo path/to/linkdemo

    mchl
        1
    mchl  
       Sep 30, 2017 via Android
    我都直接放在 /etc/nginx/conf.d/下
    zouwei
        2
    zouwei  
    OP
       Sep 30, 2017
    @mchl 嗯,我查看了一下 nginx.conf,里面有 include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; 这两句话。 这样的话放在 /etc/nginx/conf.d/下和 /etc/nginx/sites-enabled/ 效果是一样的,不过你这样更直接,不用去管 available 和 enabled 这两个概念,也免得迷惑像我这样的新手。
    BingoXuan
        3
    BingoXuan  
       Sep 30, 2017 via Android
    我的方法是直接注释 default 然后加入自己配置
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   997 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 677ms · UTC 19:00 · PVG 03:00 · LAX 12:00 · JFK 15:00
    ♥ Do have faith in what you're doing.