403 Forbidden on Rails App W/ Nginx, Passenger

403 Forbidden on Rails app w/ Nginx, Passenger

You can check the path of your passenger installation with

passenger-config --root

and the path of your ruby installation with

which ruby

then compare with the inserted in nginx.conf.

403 Forbidden when using nginx + rails + passenger

You can check the path of your passenger installation with passenger-config --root, and the path of your ruby installation with which ruby.

Rails, Passenger, Nginx, I get 403 Forbidden but why?

The error message stated:

directory index of "/var/www/cava/public/" is forbidden

which means that your folder has no index file, or the file that is to be treated as index.

I am not familiar with Passenger, but if you’ll try to put there index.html file with content <h1>Hello World</h1>, it will be likely shown.


The below is not directly related to this problem, but I’ll leave it here for the sake of consistency.

Solution 1

First, determine what user your nginx runs as

ps ueax|grep 'nginx: worker'|grep -v grep|cut -f1 -d' '
#⇒ www-data

or it might be nobody, but in your case it’s www-data according to your conf file.

Change permissions on /var/www/cava/public:

sudo chown -R www-data /var/www/cava/public

Retry, it should work now.

Solution 2

Make your nginx be running as your user. At the very top of conf change:

- user www-data:
+ user tasos;

The latter one is probably more handy for development.

403 Forbidden - Nginx + Passenger - Rails

You don't need to add passenger_ruby and passenger_ruby in nginx file. You can look into the file /etc/nginx.conf. you can see passenger_root and passenger_ruby having the ini extension just uncomment it. Or there will be line that looks like include /etc/passenger.conf just uncomment it. I think your problem is with passenger wrapper.

nginx + passenger + rails - 403 forbidden error

change

/home/appuser/test_app

to

/home/appuser/test_app/public


Related Topics



Leave a reply



Submit