Skip to content

Instantly share code, notes, and snippets.

@htanata
Created November 21, 2011 22:00
Show Gist options
  • Select an option

  • Save htanata/1384091 to your computer and use it in GitHub Desktop.

Select an option

Save htanata/1384091 to your computer and use it in GitHub Desktop.
Ubuntu Apache SSL proxy for Rails in development mode
<VirtualHost rails.localhost:80>
ServerName rails.localhost
ProxyPass / http://rails.localhost:3000/ retry=0
ProxyPassReverse / http://rails.localhost:3000
ProxyPreserveHost on
XSendFile on
XSendFileAllowAbove on
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>
<VirtualHost rails.localhost:443>
SSLEngine On
ServerName rails.localhost
ProxyPass / http://rails.localhost:3000/ retry=0
ProxyPassReverse / http://rails.localhost:3000
ProxyPreserveHost on
RequestHeader set X_FORWARDED_PROTO 'https'
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
XSendFile on
XSendFileAllowAbove on
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment