3
我目前在使用Apache代理瘦(使用此article)在Rails中,我应该启用serve_static_assets吗?
我的静态资产没有工作(例如样式表,JavaScript的)。 Apache应该为他们服务还是必须在config/environments/production.rb
中启用config.serve_static_assets
?如果Apache应该为他们服务,那么我可能做错了什么?
这里是我的Apache配置:
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /home/r/public_html/example/public
RewriteEngine On
<Proxy balancer://thinservers>
BalancerMember http://127.0.0.1:5000
BalancerMember http://127.0.0.1:5001
BalancerMember http://127.0.0.1:5002
</Proxy>
# Redirect all non-static requests to thin
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L]
ProxyPass/balancer://thinservers/
ProxyPassReverse/balancer://thinservers/
ProxyPreserveHost on
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
# Custom log file locations
ErrorLog /home/r/public_html/example/log/error.log
CustomLog /home/r/public_html/example/log/access.log combined
</VirtualHost>
Duh!我忘记了那些只是创建代理循环的代码行。这就是我们从2008年开始遵循的指示。 – rxgx