【发布时间】:2012-04-13 07:57:08
【问题描述】:
我有一个独立运行的 rails 应用程序,运行良好。我正在运行 apache,并使用带有反向代理的 VirtualHost 来为我的 Rails 应用程序提供服务。这行得通。但是我的资产没有通过虚拟主机提供服务,而是出现代理错误。
我的 httpd.conf
<VirtualHost *:80>
ServerName greekpeep_rails.nightowls.co
DocumentRoot /home/railsapps/www/greekpeep/public
ProxyPass / http://127.0.0.1:4000
ProxyPassReverse / http://127.0.0.1:4000
<Directory /home/railsapps/www/greekpeep/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
代理错误
代理错误
代理服务器收到来自上游服务器的无效响应。 代理服务器无法处理请求 GET /assets/application- 6fc7d25aa72d2a014ae6b36136c2fbfc.css。
原因:DNS 查找失败:127.0.0.1:4000assets
请注意,127.0.0.1:4000 可以完美运行,并且可以正确地为资产提供服务。 greekpeep_rails.nightowls.co 加载页面,但不加载资产。
【问题讨论】:
标签: ruby-on-rails apache passenger reverse-proxy assets