Skip to content

Instantly share code, notes, and snippets.

@hazelement
Created April 9, 2019 18:53
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 hazelement/f69b2043b470770730e936727b9b2067 to your computer and use it in GitHub Desktop.
Save hazelement/f69b2043b470770730e936727b9b2067 to your computer and use it in GitHub Desktop.
Apache
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName myserver.com
ProxyPreserveHost On
ProxyRequests Off
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:8000/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://localhost:8000/$1 [P,L]
ProxyPassReverse / http://localhost:8000/
SSLCertificateFile /etc/letsencrypt/live/myserver.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/myserver.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/myserver.com/chain.pem
</VirtualHost>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment