views:

89

answers:

1

I followed this tutorial more or less... I installed the passenger gem, executed passenger-install-ginx-module, sucessfully installed nginx and inserted this into the config:

server {
  listen 80;
  server_name localhost;
  root /home/admin/sintest/public;   # <--- be sure to point to 'public'!
  passenger_enabled on;
}

In /home/admin/sintest I have: an empty public folder, the config.ru:

require 'sinatra'

set :env,  :production
disable :run

require './app.rb'    #the app itself

run Sinatra::Application

and a test sinatra app.rb:

require 'sinatra'

get '/' do
  "hello world!"
end

Now when I run nginx and open up http://localhost what I get is: 403 Forbidden

What am I doing wrong? Have I missed something?

A: 

Make sure that user nginx running (in most case nobody or www-data) has permission to read contents of your home directory /home/admin.

Also you can look into nginx logs and read there what error exactly was.

lest
2010/09/14 18:36:04 [error] 12131#0: *2 "/home/admin/sintest/public/index.html" is forbidden (13: Permission denied), client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost" in the error.log... but it should evaluate the url with sinatra? thats the whole point of passenger?
apirogov
I was not aware that nginx runs as nobody as default... ok I fixed it... thanks
apirogov