V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
brucmao
V2EX  ›  NGINX

学习 nginx,遇到文件夹改名了无法访问的问题

  •  
  •   brucmao · Aug 15, 2022 · 1903 views
    This topic created in 1351 days ago, the information mentioned may be changed or developed.
    location / {
                root   html;
                index  index.html index.htm;
            }
            
    

    我将 html 改成 html2 ,同时把系统中 html 文件夹也改名为 html2

    location / {
                root   html2;
                index  index.html index.htm;
            }
            
    

    为啥就不能访问 index 页面呢

    使用绝对路径是可以的

    location / {
                root   C:/Users/brucm/scoop/persist/nginx/html2;
                index  index.html index.htm;
            }
            
    
    2 replies    2022-08-15 21:05:32 +08:00
    FrankAdler
        1
    FrankAdler  
       Aug 15, 2022 via iPhone   ❤️ 1
    看看 404 日志就能猜到原因吧
    brucmao
        2
    brucmao  
    OP
       Aug 15, 2022
    @FrankAdler 感谢,找到原因了,原来 scoop 安装的,用了目录链接
    https://s3.bmp.ovh/imgs/2022/08/15/0ed37a23c4071d60.png
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5624 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 07:57 · PVG 15:57 · LAX 00:57 · JFK 03:57
    ♥ Do have faith in what you're doing.