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

使用相对地址软连接到/etc/nginx/site-enabled/xxx.conf 无法通过测试

  •  
  •   albert0yyyy · Jan 7, 2023 · 1362 views
    This topic created in 1236 days ago, the information mentioned may be changed or developed.

    比如当前目录有 nginx 配置文件

    t.conf

    我使用:

    ln -s t.conf /etc/nginx/site-enabled/xxx.conf

    nginx -t

    报错 1:Too many levels of symbolic links

    报错 2:No such file or directory

    使用绝对地址或者硬连接就不报错,真心求教

    momocraft
        1
    momocraft  
       Jan 7, 2023   ❤️ 1
    file /etc/nginx/site-enabled/xxx.conf 同样会递归找不到文件
    需要理解软链接
    momocraft
        2
    momocraft  
       Jan 7, 2023
    #1 的补充: 如果 file 不报错 cat 应该能看到错误
    leoleoasd
        3
    leoleoasd  
       Jan 7, 2023   ❤️ 1
    软链接的时候,如果写相对路径,相对的应该是链接所在的路径? 你这样相当于把 /etc/nginx/site-enabled/xxx.conf 链接到 /etc/nginx/site-enabled/t.conf ? 改成完整路径试试?
    leoleoasd
        4
    leoleoasd  
       Jan 7, 2023
    跟你当前在哪个路径应该是没关系的
    albert0yyyy
        5
    albert0yyyy  
    OP
       Jan 7, 2023
    @leoleoasd 原来如此,我明白了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   975 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 20:01 · PVG 04:01 · LAX 13:01 · JFK 16:01
    ♥ Do have faith in what you're doing.