I am trying to get nginx to serve my rails application (with passenger), but all I am getting is the index.html
sites-enabled/financeRails is:
server {
listen 80;
server_name finance.mbdev-berkshelf;
root /srv/www/mbdev.com/public_html/public;
passenger_enabled on;
passenger_ruby /opt/rbenv/versions/1.9.3-p448/
}
I can see on the log that it's working fine:
10.0.0.1 - - [10/Oct/2013:06:27:33 +0000] "GET / HTTP/1.1" 200 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36"
But I am not getting the rails application...
Note that removing public/index.html
results in:
directory index of "/srv/www/mbdev.com/public_html/public/" is forbidden
在您的路线中提到root :to => "your_index_file_path"
。
I found the issue. I was using chef to install nginx and passenger. It appears that if passenger is installed after nginx it does not place the right attributes in /etc/nginx/ngninx.conf - resulting in rails not working.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.