2

I am using rails 3.0.7 and I have apache2 + unicorn installed in the production environment.

I have my .conffile as follows

<VirtualHost *:80>
ServerName something.com

# Point this to your public folder of teambox
DocumentRoot /pal/public

RewriteEngine On

<Proxy balancer://unicornservers>
  BalancerMember http://127.0.0.1:5000
</Proxy>

# Redirect all non-static requests to unicorn
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]

ProxyPass / balancer://unicornservers/
ProxyPassReverse / balancer://unicornservers/
ProxyPreserveHost on

<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>

Tried RewriteCond %{REQUEST_FILENAME} !-f

But it seems that apache is not serving the static requests ( the files in the public directory). All the static requests also comes to rails. What configuration am I missing ?

Gaurav Shah
  • 5,223
  • 7
  • 43
  • 71

1 Answers1

1

I know this question is fairly dated, however... I was having exactly the same issue, and couldn't find a solution anywhere. I came across this question

Removing the following works.

ProxyPass / balancer://unicornservers/
ProxyPassReverse / balancer://unicornservers/
ProxyPreserveHost on
Community
  • 1
  • 1
Rob
  • 7,039
  • 4
  • 44
  • 75