0
votes

Note: passenger standalone working fine with my rails application, since i need to deploy multiple rails application, so i am in need of passenger-install-nginx-module

OS ubuntu 12.04 LTS 64 bit

Ruby REE 1.8.7 (installed through brightbox repo)

Rails 2.3.17

Nginx installed through passenger-install-nginx-module

Passenger 3.0.19

Nginx 1.2.6

My nginx.conf

/opt/nginx/conf/nginx.conf

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-3.0.19;
    passenger_ruby /usr/bin/ruby1.8;

    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;
        root   /home/sampath/railsdemoapp/public;
        passenger_enabled on;  

}
}

when i start the nginx through sudo /opt/nginx/sbin/nginx, when i access the url it shows 403 Forbidden nginx/1.2.6

1

1 Answers

1
votes

That's because Nginx is running as www-data or some other www user. He must be allowed to access '/home/sampath/railsdemoapp/public'. You need to fix your permissions.