-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Running coder behing Traefik on subpath /vscode #7110
-
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/
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
Oh my bad, thought this was Coder because of the original container name. I will move it back!
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.