Last active
March 8, 2019 12:01
-
-
Save ymauray/eb9181b80e2b4d462fc30b09cba06a5a to your computer and use it in GitHub Desktop.
Apache 2 config file to act as a reverse proxy for Visual Studio Code on the server
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
<IfModule mod_ssl.c> | |
<VirtualHost *:443> | |
ServerName code.somehost.ch | |
ProxyRequests Off | |
AllowEncodedSlashes NoDecode | |
RewriteEngine On | |
RewriteCond %{HTTP:Upgrade} =websocket [NC] | |
RewriteRule /(.*) ws://localhost:8443/$1 [P,L] | |
RewriteCond %{HTTP:Upgrade} !=websocket [NC] | |
RewriteRule /(.*) http://localhost:8443/$1 [P,L] | |
ProxyPassReverse / http://localhost:8443/ | |
ServerSignature Off | |
SSLCertificateFile /etc/letsencrypt/live/code.somehost.ch/fullchain.pem | |
SSLCertificateKeyFile /etc/letsencrypt/live/code.somehost.ch/privkey.pem | |
Include /etc/letsencrypt/options-ssl-apache.conf | |
</VirtualHost> | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment