Code-server: Traefik reverse proxy, gateway timeout

Created on 11 Mar 2019  路  6Comments  路  Source: cdr/code-server


  • code-server version: latest tag, server/0.0.0 linux-x64 node-v8.15.0

Description

Tried running it behind Traefik reverse proxy. If i browse to my url i get a gateway timeout.
In the traefik dashboard it looks correctly configured:
image
image
Running curl http://172.17.0.2:8443 on the remote host works:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /</pre>
</body>
</html>

If i expose the 8443 port publicly and browse to the ip + port it also works fine (with http)

Steps to Reproduce

  1. Create a Traefik reverse proxy (https://github.com/containous/traefik)
  2. Try running code-server with following command:
    docker run -d --label traefik.port=8443 --label traefik.frontend.rule=Host:ide.DOMAIN.TLD codercom/code-server --allow-http
bug

Most helpful comment

I have traefik running in a docker network and i forgot to "put" the code-server in the same docker network.

All 6 comments

Nvm. I was just stupid myself, if you are wondering about the issue i missed setting the correct network.

What do you mean by missed setting the correct network? I'm having the same response to GET / with docker nginx egresses.

I have traefik running in a docker network and i forgot to "put" the code-server in the same docker network.

@StiviiK would you be willing to share your relevant config for this. My proxy seems to be working as I can access code-server using my domain name however all https redirects to http. I have several other containers working with traefik.

Resolved! I was able to get things working with the following labels:

labels: - "traefik.enable=true" - "traefik.backend=vsc" - "traefik.frontend.rule=Host:vsc.example.org" - "traefik.protocol=http" - "traefik.docker.network=web" - "traefik.frontend.headers.SSLRedirect=true" - "traefik.frontend.headers.STSSeconds=315360000" - "traefik.frontend.headers.browserXSSFilter=true" - "traefik.frontend.headers.contentTypeNosniff=true" - "traefik.frontend.headers.forceSTSHeader=true" - "traefik.frontend.headers.SSLHost=example.org" - "traefik.frontend.headers.STSIncludeSubdomains=true" - "traefik.frontend.headers.STSPreload=true" - "traefik.frontend.headers.frameDeny=true"

@warllo54 this are a lot of options you require to get it working, which seems odd. Maybe i'll find my own config because i only evaluated code-server.

Ok if you come here because you try to use the docker-compose in https://hub.docker.com/r/linuxserver/code-server ... Don't be as stupid as me (or StiviiK I guess) Don't forget to add the "netword:" directive....... !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

infogulch picture infogulch  路  3Comments

oonqt picture oonqt  路  3Comments

rcarmo picture rcarmo  路  3Comments

pchecinski picture pchecinski  路  3Comments

Arsaev picture Arsaev  路  3Comments