I'm using Amazon EC2 and tried to deploy a rails project. I have install nginx/passenger and successfully made nginx server run.
I started my rails project with name "forfun" then I set the root of nginx to /home/ubuntu/rails/forfun/public
I initialized a file named "index.html", then I could see the page in browser (http://[my ip]:80)
However, what i really wanna see is the welcome page of rails app.
I tried do remove index.html and see what i got. I saw 404 Forbidden error. /var/log/nginx/error.log reveals that directory index of "/home/ubuntu/rails/forfun/public/" is forbidden
What step i actually missed?
by the way, do i need to do "rails server" while nginx is running?
ps: (1) /opt/nginx/conf/nginx.conf
http { passenger_root /usr/local/rvm/gems/ruby-2.3.0/gems/passenger-5.0.26; passenger_ruby /usr/local/rvm/gems/ruby-2.3.0/wrappers/ruby; ... server { listen 80; server_name 52.196.XX.XXX;#my amazon public ip root /home/ubuntu/rails/forfuni/public; }
(2)/etc/nginx/sites-enabled/default
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /home/ubuntu/rails/forfun/public; index index.html index.htm; }