Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Running coder behing Traefik on subpath /vscode #7110

Unanswered
jagatsingh asked this question in General
Discussion options

Hi all,

Edit: Sorry @code-asher I updated this discussion after it was moved to coder repo.

I am trying to get vscode run behind Traefik on /vscode subpath.

I have below config

 vscode:
 image: codercom/code-server:${CODER_VERSION:-latest}
 hostname: vscode
 container_name: vscode
 labels:
 - "traefik.enable=true"
 - "traefik.http.routers.vscode.rule=Host(`${HOSTNAME}`) && PathPrefix(`/vscode`)"
 - "traefik.http.routers.vscode.entrypoints=websecure"
 - "traefik.http.routers.vscode.service=vscode"
 - "traefik.http.middlewares.vscode-iplist.ipallowlist.sourcerange=${AWS_ELASTIC_IP}"
 - "traefik.http.routers.vscode.middlewares=vscode-iplist,vscode-strip-prefix"
 - "traefik.http.services.vscode.loadbalancer.server.port=8080"
 - "traefik.http.routers.vscode.tls=true"
 - "traefik.http.routers.vscode.tls.certresolver=myresolver"
 - "traefik.http.middlewares.vscode-strip-prefix.stripprefix.prefixes=/vscode"

On opening the browser it is redirecting to

https:///login

instead of

https:///vscode/login

Edit 2:

I was able to solve it by using path as

https:///vscode/

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Oh my bad, thought this was Coder because of the original container name. I will move it back!

You must be logged in to vote
1 reply
Comment options

Probably due to the the login redirect being relative. It does ./login so if you go to /vscode the browser turns that into /login but if you go to /vscode/ the browser turns that into /vscode/login.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /