添加后rewrite block
,运行Rails 3.2.12应用的Ubuntu 12.04服务器404 Not Found
进入时报错mysite.com/nbhy
。
这是一个指向nbhy
下方的符号链接,它用于托管 Rails 应用程序。重写的目的是在用户输入时重写root /var/www/
/var/www/nbhyop/current/public
/nbhy/authentify/sigin
/nbhy or /nbhy/
这是 nginx.conf 中的服务器块:
server {
listen 80;
server_name mysite.com;
root /var/www/;
passenger_enabled on;
rails_env production;
passenger_base_uri /nbhy;
}
location / {
rewrite "/nbhy" /nbhy/authentify/signin last;
rewrite "/nbhy/" /nbhy/authentify/signin last;
}
}
错误的error.log
开启nginx
是:
2013/06/09 21:36:31 [error] 32505#0: *1 open() "/var/www/nbhy/authentify/signin" failed (2: No such file or directory), client: 67.173.143.107, server: mysite.com, request: "GET /nbhy HTTP/1.1", host: "mysite.com"
在添加重写位置块之前,系统会弹出带有 url 的登录页面mysite.com/nbhy/authentify/signin
。但现在它在添加重写块后抛出错误。重写有什么问题?