I know this is a super-famous error, but i tried quite everything I found here on StackOverflow and on google without being able to solve it.
I have the following configuration:
- SLES 11 SP1 on Amazon EC2
- nginx 1.2.2
- passenger 3.0.15
- rails 3
I installed nginx and passenger and set the nginx.conf like this:
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;
}
}
...
When I access the app from the browser it keeps saying 403 forbidden. I also run chmod -R 755 on the app folder, on /var and /opt (nginx is in /opt/nginx)
In the logs, the error is:
[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: The same error appears also for /root/myapp/public/index.html (which doesn't exist)
[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: Same error also when I run passenger in standalone mode:
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"