Created
July 29, 2013 13:50
-
-
Save mschmitt/6104429 to your computer and use it in GitHub Desktop.
Apache mod_rewrite reverse proxy with SSL bound to two ports, proxying to two separate backends
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost _default_:443 _default_:8443> | |
# Force %{SERVER_PORT} to contain the actual local port of the connection | |
UseCanonicalPhysicalPort On | |
RewriteEngine On | |
# Reverse Proxy to localhost:80 if connection was to port 443 | |
RewriteCond %{SERVER_PORT} =443 | |
RewriteRule (.*) http://localhost$1 [P] | |
# Reverse Proxy to localhost:8080 if connection was to port 8443 | |
RewriteCond %{SERVER_PORT} =8443 | |
RewriteRule (.*) http://localhost:8080$1 [P] | |
SSLEngine On | |
SSLCertificateFile /etc/httpd/ssl/foo.crt | |
SSLCertificateKeyFile /etc/httpd/ssl/foo.key | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment