我知道這是一個超級着名的錯誤,但我嘗試了我在StackOverflow和Google上找到的所有內容,但都無法解決它。Nginx 1.2,Passenger 3.0,Rails 3:403禁止錯誤
我具有以下配置:
- SLES在Amazon EC2
- nginx的1.2.2
- 乘客3.0.15
- 導軌3
我安裝nginx的11 SP1和乘客,並像這樣設置nginx.conf:
http {
passenger_root /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.15;
passenger_ruby /usr/bin/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location/{
root /root/myapp/public;
autoindex on;
passenger_enabled on;
}
}
...
當我從瀏覽器訪問應用程序時,它一直說403被禁止。 我還請運行chmod -R 755上的應用程序文件夾中,上/ var和/選擇(nginx的是在/ opt/nginx的)
在日誌,所述錯誤是:
[error] 5240#0: *1 open() "/root/myapp/public/favicon.ico" failed (13: Permission denied), client: 188.11.5.49, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "ec2-54-247-18-139.eu-west-1.compute.amazonaws.com"
UPDATE :還出現/root/myapp/public/index.html相同的錯誤(不存在)
[error] 5638#0: *1 "/root/myapp/public/index.html" is forbidden (13: Permission denied), client: 188.11.5.49, server: localhost, request: "GET/HTTP/1.1", host: "ec2-54-247-18-139.eu-west-1.compute.amazonaws.com"
UPDATE 2:同樣的錯誤也當我運行在獨立模式下乘客:
You can stop Phusion Passenger Standalone by pressing Ctrl-C.
===============================================================================
2012/08/30 08:31:34 [error] 7834#0: *4 "/root/myapp/public/index.html" is forbidden (13: Permission denied), client: 127.0.0.1, server: _, request: "HEAD/HTTP/1.1", host: "0.0.0.0"
它沒有工作:( – lucaronin
嘗試重新啓動nginx的服務器。 –
已經嘗試過,什麼都沒有改變.. – lucaronin