【Nginx】常見問題

kingdelee發表於2019-08-12

常見問題

directory index of "/home/project/guache/guache_web_admin/dist" is forbidden

報錯:

2019/08/12 15:00:28 [error] 6752#6752: *1 directory index of "/home/project/guache/guache_web_admin/dist" is forbidden, client: 114.242.38.197, server: localhost, request: "GET /guache/admin/ HTTP/1.1", host: "47.111.170.98"

2019/08/12 15:03:57 [error] 6752#6752: *65 open() "/home/project/guache/guache_web_admin/distindex.html" failed (2: No such file or directory), client: 114.242.38.197, server: localhost, request: "GET /guache/admin/index.html HTTP/1.1", host: "47.111.170.98"

檢視了檔案許可權,是沒問題的
再看配置檔案,發現粗心的寫錯了路徑格式

【Nginx】常見問題
修改後就好了

location /guache/ {
               alias /home/project/guache/guache_web/dist/;
        }

        location /guache/admin/ {
              alias /home/project/guache/guache_web_admin/dist/;
        }