Created
February 17, 2018 13:41
-
-
Save KyonLi/529cf06e6c4a5cd622590ba0f5728ee2 to your computer and use it in GitHub Desktop.
Apache2 websocket proxy
This file contains 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 *:443> | |
ServerName mysite.com | |
ServerAlias www.mysite.com | |
SSLEngine on | |
SSLProxyEngine on | |
ProxyPreserveHost on | |
ProxyRequests Off | |
SSLCertificateFile /etc/apache2/ssl/mysite.com.crt | |
SSLCertificateKeyFile /etc/apache2/ssl/mysite.com.key | |
SSLCertificateChainFile /etc/apache2/ssl/ca.cer | |
DocumentRoot /var/www/errorPages | |
ErrorDocument 503 /503.html | |
ProxyPass /503.html ! | |
ProxyPass / http://localhost:3999/ | |
ProxyPassReverse / http://localhost:3999/ | |
RewriteEngine on | |
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC] | |
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC] | |
RewriteRule .* ws://localhost:3999%{REQUEST_URI} [P] | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment