【发布时间】:2016-01-28 22:52:14
【问题描述】:
我的服务器上有两个 Rails 应用程序。它们中的每一个都在瘦服务器上运行。我也在使用 NGINX。这是我的 NGINX 配置文件:
server{
location /blog {
proxy_pass http://127.0.0.1:8082;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /website1 {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
"http://HOST/blog" => 我收到 404 错误(空白页)
"http://[HOST]/website1" => 我的 Rails 应用程序出现 404 错误,在我的应用程序日志中我得到:
INFO -- : Started GET "/website1"
FATAL -- : ActionController::RoutingError (No route matches [GET] "/website1")
发生了什么???
我尝试将网站 1 的位置设置在“/”上,将博客的位置设置在“/blog”上。在这种情况下,网站 1 运行良好,但我仍然在博客上收到 404(空白页面,而不是 rails 页面)。
有什么想法吗?谢谢你的帮助!
【问题讨论】:
标签: ruby-on-rails ruby nginx thin proxypass