Skip to content

Instantly share code, notes, and snippets.

@slavanap
Created September 7, 2018 22:04
Show Gist options
  • Save slavanap/cf37ff4438fb55dee1bed3cc7a4ca4ce to your computer and use it in GitHub Desktop.
Save slavanap/cf37ff4438fb55dee1bed3cc7a4ca4ce to your computer and use it in GitHub Desktop.
<VirtualHost *:80>
Alias "/.well-known" "/var/www/html/.well-known"
# redirect other paths to https
RewriteEngine On
RewriteCond %{REQUEST_URI} !/.well-known/.*
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/ [R,L]
</VirtualHost>
<VirtualHost *:443>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:50000/
ProxyPassReverse / http://127.0.0.1:50000/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/contoso.org/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/contoso.org/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/contoso.org/fullchain.pem
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment