Skip to content

Instantly share code, notes, and snippets.

@epcim
Created October 20, 2015 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epcim/1f41fa956adeaef025fc to your computer and use it in GitHub Desktop.
Save epcim/1f41fa956adeaef025fc to your computer and use it in GitHub Desktop.

Apache reverse proxy - basics

http://www.apachetutor.org/admin/reverseproxies

Note: ProxyPassReverse reverzne prepise jen URL v hlavice stranky, Tj. aplikace potom but musi generovat vsechny odkazy relativne od BASE_URI. Nebo je treba pouzit mod_proxy_html: http://httpd.apache.org/docs/current/mod/mod_proxy_html.html (ktery prepise klidne i linky a odkazy vne HTML dokumentu)

<VirtualHost :443>

    ServerName <server url>
    SSLEngine on
    SSLCertificateFile /etc/ssl/localcerts/<certname>.crt
    SSLCertificateKeyFile /etc/ssl/localcerts/<keyname>.key
<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

SSLProxyEngine on
ProxyRequests Off
ProxyPass / https://<url>:4443/
ProxyPassReverse / https://<url>/

Header edit Location ^http://<url>/ https://<url>/
RequestHeader set X-Forwarded-Proto "https"

ProxyPass lze davat i nejake argumenty

ProxyPass /redmine-vsm2 https://10.20.30.131/redmine-vsm2 retry=0 timeout=5 ProxyPassReverse /redmine-vsm2 https://10.20.30.131/redmine-vsm2

Toto jsem pridal, nebot jsme meli nejake problemy z IE

SetEnvIf User-Agent ".MSIE."
nokeepalive ssl-unclean-shutdown
downgrade-1.0 force-response-1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment