I am setting up Rails application on AWS Ubuntu 16.04 LTS using Nginx & Passenger. I am getting 403 Forbidden error. I have checked permission and ownership but it seems like it is not working.
Ruby version: 2.5.1 .
Nginx.conf
Under /etc/nginx/nginx.conf
I am using deploy
user. I have not changed anything other than user deploy
in this file. Here is snippet:
user deploy;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
Passenger.conf : Changed passenger_ruby
path in this file. I am using rvenv
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /home/deploy/.rbenv/shims/ruby;
sites-enabled/default: In here I have removed everything and following
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com
passenger_enabled on;
rails_env production;
root /var/www/html/app-name/current/public;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
#server_name _;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
Note: I am also tried setting the permission 777 chmod 777 -R app-name
, but it still doesn't work.