9

I have install Nginx server and configured all needed stuff, but currently I'm having error with 403 forbidden error. Log says:

2010/12/28 17:38:59 [error] 28664#0: *27 directory index of "/home/appuser/test_app" is forbidden, client: xxx.xxx.xxx.xxx, server: localhost, request: "GET / HTTP/1.1", host: "xxx.xxx.xxx.xxx"

My config:

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    passenger_root /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.2;
    passenger_ruby /usr/bin/ruby;
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;
        root /home/appuser/test_app;
        passenger_enabled on;
    }
}

Any solutions?

thesis
  • 2,565
  • 5
  • 26
  • 37

3 Answers3

14

change

/home/appuser/test_app

to

/home/appuser/test_app/public
Tiankui
  • 322
  • 4
  • 8
3

The nginx root directive should point to the 'public' directory of the app.

lbadura
  • 41
  • 3
0

By any chance are you using rvm to install Ruby? Judging by your paths, you aren't. But in case you are, you need to be careful with the passenger_* configuration options. Take a look here: Rails 3.1, nginx, Passenger directory index forbidden

Community
  • 1
  • 1
alexlod
  • 1,363
  • 2
  • 10
  • 18