You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Traefik for reverse proxy.
I want to use code-server domain like https://<mydomain>/vscode <-> docker code-server
but when I set subdomain to code-server, always show me error page by traefik (401 error)
I think it occured by redirecting to login page
When I test same option and change code-server running into root domain(https://<mydomain>), It works, but when I use subdomain(https://<mydomain>/vscode), It broken.
My code server version is 3.2.0 + linux-server's docker image
I don't know it is traefik setting issue or code-server issue exactly.
Please help
code-server expects the reverse proxy to rewrite the URL so /vscode becomes /. I'm not familiar with Traefik so I'm not sure exactly how that's done but it looks like there's a PathPrefixStrip you can use.
The second thing is to make sure you browse to the page with a trailing slash, i.e. https://<mydomain>/vscode/. This is because code-server uses relative URLs like ./static/... and if there's no trailing slash they'll go against the root instead of the sub-path.
Activity
code-asher commentedon May 8, 2020
code-server expects the reverse proxy to rewrite the URL so
/vscodebecomes/. I'm not familiar with Traefik so I'm not sure exactly how that's done but it looks like there's aPathPrefixStripyou can use.The second thing is to make sure you browse to the page with a trailing slash, i.e.
https://<mydomain>/vscode/. This is because code-server uses relative URLs like./static/...and if there's no trailing slash they'll go against the root instead of the sub-path.deadcatssociety commentedon May 9, 2020
PathPrefixStripremoved since traefik 1.4, current version is 2.2.it's not work. I think something I set wrong config. (or not work with url sub path)
I will check traefik's document and forum.
Thanks for your advice!
deadcatssociety commentedon May 12, 2020
I fix the problem.
someone like me, use this settings:
important point is
stripprefixthanks code-asher you give inspiration to me :D
code-asher commentedon May 12, 2020
Awesome, I'm glad you got it sorted!