Macario
Macario

Reputation: 2244

Forbidden message when serving a sinatra local site using nginx passenger

I've followed the instructions for installing phusion passenger with nginx in ubuntu. I had some issues while installing since I use rvm and I had to install as root and the installer was failing to find rake so i temporarily chmoded /opt to be owned by my user and after installation I resetted ownership to root. I can see nginx welcome page but when I try to visit a sinatra app I get forbidden, the virtual host is pointed to the sinatra app public dir and the permissions for the whole app are 777.

Upvotes: 3

Views: 830

Answers (4)

Macario
Macario

Reputation: 2244

Well my mistake was not using rvmsudo to install nginx with passenger, instructions here: http://rvm.io/integration/passenger/.

Upvotes: 0

chbrown
chbrown

Reputation: 12028

Because this is the page that Google brought me to for my issue, which isn't a Passenger issue, but a Nginx reverse-proxy issue, you need to add the line

disable :protection

somewhere in your sinatra app. I have mine at the very end, outside any method (in global scope).

Upvotes: 0

Hongli
Hongli

Reputation: 18924

Try Passenger 3. It automatically detects most permission problems and tells you how to fix them.

Upvotes: 1

Paul
Paul

Reputation: 2728

If this is for a production system, you really don't need the flexibility of RVM as you should be using a single stable version of Ruby and Rails for Phusion. Install the version you need, using Aptitude if that version is available, and be done with it.

Upvotes: 0

Related Questions