[英]403 forbidden for nginx locations
我有一個sites-enabled/default
Nginx sites-enabled/default
配置:
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location ~ /anotherroute {
alias /home/anotherroute/public;
index index.html;
}
}
當我訪問http://myipaddress/anotherroute
它工作正常,但是當我做http://myipaddress/anotherroute/yetanotherroute
它回來為403 forbidden
。
我怎樣才能解決這個問題?
可能您的文件夾還存在yetanotherroute
,請確保您已經有文件index.php
或index.html
否則,您應該指定一個文件名,例如: http://myipaddress/anotherroute/yetanotherroute/somefile.php
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.