code-server behind apache proxy
See original GitHub issueDescription
I can’t figure out the correct apache config in order to proxy https and wss requests correctly. My apache config looks something like this:
<VirtualHost *:443>
ServerName code.mydomain.net
ProxyRequests off
ProxyPreserveHost on
AllowEncodedSlashes NoDecode
RequestHeader set X-Forwarded-Proto https
RequestHeader set X-Forwarded-Port 443
ProxyPass / http://code.code:8080/ nocanon
ProxyPassReverse / http://code.code:8080/
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
My problem is now, that this configuration blocks all websocket requests. In order to also proxy websocket connections I would need to add something like this to my apache config:
ProxyPass / ws://code.code:8080/
ProxyPassReverse / http://code.code:8080/
The problem with this is, that this will not work with the same url path like the https proxy statements (https://code.mydomain.net/ and wss://code.mydomain.net/). Usually the websocket connection would be handled by a different path (eg.: wss://code.mydomain.net/websocket/). So my question is: Is there any way to achieve this with code-server and apache?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
How to run code-server behind Cloudflare and Apache (same ...
Hi! Currently I have a VPS proxied by Cloudflare, with a reverse-proxy under Apache to run my various servers.
Read more >how to convert nginx config file from code-server to apache2 ...
So finally I found the solution to my problem, I had to use apache reverse proxy. I didn't understand all the code but...
Read more >Usage - code-server v4.8.0 docs - Coder
If you're working on web services and want to access them locally, code-server can proxy to any port using either a subdomain or...
Read more >Run code-server with Apache - chrislynch.link
Caddy can create a reverse proxy to code-server, letting you access it over SSL on port 443 easily even though it is really...
Read more >mod_proxy - Apache HTTP Server Version 2.4
Apache HTTP Server can be configured in both a forward and reverse proxy (also known as gateway ) mode. An ordinary forward proxy...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve those rules after the ServerName definition and it seem’s to do the job.
This stopped working for V2, do you know how to fix it? Thanks.