Skip to content

[Bug]: 'Error: WebSocket close with status code 1006' behind nginx proxy #6023

Description

@zirui

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: edge
  • Local OS: macos
  • Remote OS: ubuntu
  • Remote Architecture: x86
  • code-server --version: 4.6.0

Steps to Reproduce

proxy with nginx:

  location /code/ {
      proxy_pass https://0.0.0.0:9997/;
      proxy_http_version 1.1;
      proxy_set_header Host $host;
      proxy_set_header Upgrade $http_upgrade;
      proxy_read_timeout 86400;
      proxy_set_header Connection $connection_upgrade;
      proxy_set_header Accept-Encoding gzip;
  }

run code-server

code-server  --cert MyCertificate.crt --cert-key MyKey.key --port 9997
  1. visit from url: ${myhost}/code/

Expected

Code server opens up to home screen.

Actual

error log:
z1

Logs

z2

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTP.

Notes

Why does code-server create a websocket connection with port 80? And how can this issue be solved?

The network environment of the host machine:
The port 80 has been disabled by the administrator of the host machine, only a few ports are open.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageThis issue needs to be triaged by a maintainer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions