Skip to content

Instantly share code, notes, and snippets.

@alanho
Created April 21, 2013 03:50
Show Gist options
  • Save alanho/5428387 to your computer and use it in GitHub Desktop.
Save alanho/5428387 to your computer and use it in GitHub Desktop.
Rails with Apache
ServerName www.example.com:80
DocumentRoot "/path/to/rails/app/public"
RewriteEngine On
<Proxy balancer://railsapp>
BalancerMember http://127.0.0.1:5000
BalancerMember http://127.0.0.1:5001
</Proxy>
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://railsapp%{REQUEST_URI} [P,QSA,L]
<Directory />
...
...
...
</Directory>
<Directory "/path/to/rails/app/public">
Options -Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# For SSL Site only
RequestHeader set X_FORWARDED_PROTO "https"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment