-
Notifications
You must be signed in to change notification settings - Fork 6.3k
BaseURL / root path has changed with port forward in coder-server #7115
-
I am sure I have missed a configuration but not sure which is it.
I am running coder in Kubernetes with nginx ingress. I created a workspace, start coder-server and run tomcat on port 8080 in coder terminal
code-server automatically create the port fowarding with a local address
https://coder.mydomain.com/@barrowk/coder-test.main/apps/code-server/proxy/8080/
when I access my app , eg
https://coder.mydomain.com/@barrowk/coder-test.main/apps/code-server/proxy/8080/test/helloworld
this works fine. however, all links inside this page has broken because it points to the coder server url.
eg
https://coder.mydomain.com/@barrowk/coder-test.main/apps/code-server/proxy/8080/image/abc.png
become
https://coder.mydomain.com/image/abc.png
the proxy part "@barrowk/coder-test.main/apps/code-server/proxy/8080" has removed by the port forwarding.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
I think you can make this work by:
- Using
absproxy
instead ofproxy
(absproxy
does not rewrite the URL, so it is necessary for apps that do not work relatively). - Passing
--abs-proxy-base-path /@barrowk/coder-test.main/apps/code-server
to code-server.
So, https://coder.mydomain.com/@barrowk/coder-test.main/apps/code-server/absproxy/8080/image/abc.png for example should work after that, I believe.
Unfortunately, the ports panel always uses proxy
, not absproxy
, so you have to manually type it in the URL. I think there is a feature request to allow choosing which to use from the ports panel.
https://github.com/coder/code-server/blob/main/docs/guide.md#prefixing-absproxyport-with-a-path
Beta Was this translation helpful? Give feedback.