Nginx Rails 403 Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this 403 forbidden nginx rails site About Us Learn more about Stack Overflow the company Business Learn more directory index of is forbidden nginx passenger about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x rails apache passenger 403 forbidden Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up 403 Forbidden rails raise 403 on Rails app w/ Nginx, Passenger up vote 8 down vote favorite 1 First off, apologies: I know the 403 Forbidden question is a common one for Rails/Nginx installs, but none of the answers I've read so far have solved it for me. Disclaimer: This is my first time deploying a Rails app somewhere that isn't Heroku. Please be gentle. ;) Situation: I have
Rails Nginx Unicorn 403 Forbidden
a Rails app running on an Ubuntu 12.04 server, running Nginx (installed with Passenger). I've deployed my app to my server correctly, but when I attempt to access the site, I receive a 403 Forbidden error. Checking my error logs, I see: 2013/10/23 22:47:01 [error] 27954#0: *105 directory index of "/var/www/colepeters.com/current/public/" is forbidden, client: 50.3…server: colepeters.com, request: "GET / HTTP/1.1", host: "colepeters.com" 2013/10/23 22:47:10 [error] 27954#0: *106 directory index of "/var/www/colepeters.com/current/public/" is forbidden, client: 184…server: colepeters.com, request: "GET / HTTP/1.1", host: "colepeters.com" 2013/10/23 22:47:12 [error] 27954#0: *107 directory index of "/var/www/colepeters.com/current/public/" is forbidden, client: 151…server: colepeters.com, request: "GET / HTTP/1.1", host: "colepeters.com" However, when checking permissions on this directory, I see that the user I have setup to use Nginx had both read and execute permissions on it. Here's the relevant info from my nginx.conf: user XXXX; 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 /home/cole/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.21; passenger_ruby /home/cole/.rvm/wrappers/ruby-2.0.0-p247/ruby; 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; keepal
have one accepted answer. Are you sure you want to replace the current answer with this one? Yes, I'm sure. Changed your mind? You previously marked this answer as accepted. Are
Passenger Directory Index Is Forbidden
you sure you want to unaccept it? Yes, I'm sure. Sign Up Log directory index of public is forbidden In submit Tutorials Questions Projects Meetups Main Site logo-horizontal DigitalOcean Community Menu Tutorials Questions Projects Meetups Main Site Sign Up Log passenger rails nginx In submit View All Results By: renatocassino Subscribe Subscribed Share 0 Problem 403 in rails app with nginx. May 23, 2014 4.3k views Hello guys. I configured my Nginx to run passenger with http://stackoverflow.com/questions/19553907/403-forbidden-on-rails-app-w-nginx-passenger Nginx module. My PHP applications work normally. In my nginx.conf file I put the following: server { listen 80; server_name mywebsite.com www.mywebsite.com; root /var/ www/mywebsite.com/current/public; passenger_enabled on; } In the public folder I ran "chmod-R 755 public" and then immediately "chown www-data: www-data public." 'm Having 403 error. "403 Forbidden nginx/1.6.0" In my error.log I can see this. 2014/05/23 13:04:16 [error] 23505#0: *295 directory https://www.digitalocean.com/community/questions/problem-403-in-rails-app-with-nginx index of "/var/www/mywebsite.com/public_html/current/" is forbidden, client: , server: mywebsite.com, request: "GET / HTTP/1.1", host: "mywebsite.com" What am I doing wrong? My regards. Renato Log In to Comment Leave a Comment Add comments here to get more clarity or context around a question. To answer a question, use the “Answer” field below. Log In to Comment 3 Answers 0 sianios May 23, 2014 Try this, its different from the one you used. chown -R www-data:www-data public Reply Log In to Comment 0 renatocassino May 23, 2014 Thanks for your answer. I tried this, but doesn't work too. Help me!! Reply Log In to Comment 0 renatocassino May 25, 2014 I solved the problem. The problem was the wrong address to passenger_root. I fixed and worked! xD Reply Log In to Comment Have another answer? Share your knowledge. Log In to Answer Copyright © 2016 DigitalOcean™ Inc. Community Tutorials Questions Projects Tags Newsletter RSS Distros & One-Click Apps Terms, Privacy, & Copyright Security Report a Bug Get Paid to Write Almost there! Sign into your account, or create a new one, to start interacting. Log In Sign Up Report a Bug Use this form to report bugs related to the Community Report a bug:
have one accepted answer. Are you sure you want to replace the current answer with this one? Yes, I'm sure. Changed your mind? You previously marked this https://www.digitalocean.com/community/questions/how-do-i-resolve-403-forbidden-for-nginx-passenger-rails-centos-7-setup answer as accepted. Are you sure you want to unaccept it? Yes, I'm sure. Sign Up Log In submit Tutorials Questions Projects Meetups Main Site logo-horizontal DigitalOcean Community Menu Tutorials Questions Projects Meetups Main Site Sign Up Log In submit View All Results By: vmcilwain Subscribe Subscribed Share 0 How do I resolve 403 Forbidden for nginx + passenger + rails + centos 403 forbidden 7 setup April 7, 2015 2.3k views Ruby on Rails Nginx CentOS Hello all, I am trying to set up a production server and am having a little bit of trouble. I am hoping someone can help me. I am new to Nginx. I usually use Apache for setting up my rails servers but decided I wanted some experience with Nginx. I followed the directory index of tutorial located below for setting up my server: http://karolgalanciak.com/blog/2013/07/19/centos-6-4-server-setup-with-ruby-on-rails-nginx-and-postgresql/ Once I was done with this tutorial, I attempted to hit my sample application with a browser and got the 403 error. When I checked the error log I get the following: 2015/04/07 09:59:37 [error] 30642#0: *1 open() "/apps/my_app/public/tasks" failed (2: No such file or directory), client: ##.##.###.##, server: www.lovell.direct, request: "GET /tasks HTTP/1.1", host: "www.lovell.direct" I installed lynx to see if I could hit it via a browser without having to hit the web but I then get a 404 error where the error log says the same thing but the host is localhost instead of the domain address. I saw in some of the questions that the answer was making sure I had a default route which I do. And also to make the files executable which I didn't understand that. I am not sure why I would need to make my views executable (if I understood correctly). I am looking to see what might be going on wrong. Here is what my nginx.conf file look like worker_processes 1; events { worker_connections 1024; } http { passenger_root /home/deploy/.rvm/gems/rub