2016-04-13 180 views
0

我有一個nginx的sites-enabled/default配置:403禁止nginx的位置

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

我該如何解決這個問題?

回答

0

也許是你的文件夾yetanotherroute是存在的,要確保你有文件index.phpindex.html已經

否則,你應該指定一個文件名,如:http://myipaddress/anotherroute/yetanotherroute/somefile.php