我能够部署一个站点(http://taiga.market),看起来Nginx在索引页面上工作。如果你点击一个链接转到另一个页面(http://taiga.market/login),Nginx会回复404.它会为除索引之外的每个页面执行此操作,我不明白为什么。
我认为它是SSL,但事实证明,未受保护的页面也不会呈现。
我不确定发生了什么。 nginx配置如下:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
index index.html index.htm;
server_name taiga.market;
passenger_enabled on;
rails_env production;
root /home/deploy/taiga/current/public;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
在production.log或nginx的error.log中没有记录任何内容,但是access.log中有信息:
24.85.70.29 - - [15/Mar/2015:01:51:01 -0400] "GET / HTTP/1.1" 200 1613 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36"
24.85.70.29 - - [15/Mar/2015:01:51:04 -0400] "GET /user/spree_user/sign_in HTTP/1.1" 404 715 "http://taiga.market/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36"
24.85.70.29 - - [15/Mar/2015:01:51:04 -0400] "GET /user/spree_user/sign_in HTTP/1.1" 404 715 "http://taiga.market/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36"
答案 0 :(得分:3)
答案很简单:为了正确处理导轨passenger
,请删除以下行:
location / {
try_files $uri $uri/ =404;
}