Skip to content

Instantly share code, notes, and snippets.

@0xh3xa
Last active April 4, 2018 14:01
Show Gist options
  • Select an option

  • Save 0xh3xa/d129d9bd973e9b25a8d48ff3b27ae777 to your computer and use it in GitHub Desktop.

Select an option

Save 0xh3xa/d129d9bd973e9b25a8d48ff3b27ae777 to your computer and use it in GitHub Desktop.
Configure Apache2 httpd as Reverse proxy with https support
<VirtualHost *:443>
ServerName exmple.com
ServerAlias *exmple.com
ServerAdmin user@gmail.com
ProxyPreserveHost On
ProxyRequests off
AllowEncodedSlashes NoDecode
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/exmple.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/exmple.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ProxyPass / http://localhost:8080/ nocanon
ProxyPassReverse / http://localhost:8080/
# RequestHeader set X-Forwarded-Proto "https"
# RequestHeader set X-Forwarded-Port "443"
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment