code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Bug]: "File not found: ..." response when code-server is behind NGINX

Open Marekuss opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser: Firefox
  • Local OS: Windows 10
  • Remote OS: AlpineLinux 3.16
  • Remote Architecture: amd64
  • code-server --version: 4.6.0 6d3f9ca6a6df30a1bfad6f073f6fa33c0e63abdb with Code 1.70.1

Steps to Reproduce

  1. install code-server with YARN
  2. configure and run NGINX on port 80 with proxy_pass http://127.0.0.1:8080
  3. run: code-server --auth none --bind-addr 127.0.0.1:8080 --verbose
  4. connect with browser to code-server web page

Expected

code-server web page is displayed

Actual

code-server page is blank

Logs

File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/browser/browser.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/common/cancellation.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/common/lifecycle.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/common/event.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/common/marshalling.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/common/network.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/common/resources.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/parts/request/browser/request.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/common/uri.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/platform/product/common/product.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/platform/window/common/window.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/common/path.js File not found: /home/devel/node_modules/code-server/lib/vscode/out/vs/base/common/strings.js

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • [X] I cannot reproduce this in VS Code.
  • [X] I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • [X] I am using HTTPS.

Notes

code-server listen on localhost:8080 server has opened port 0.0.0.0:80

  1. Without NGINX a) $ code-server --auth none --bind-addr 127.0.0.1:8080 --verbose b) $ socat tcp-listen:80,reuseaddr,fork tcp:localhost:8080 c) open code-server page on particular address -> SUCCESS image

  2. With NGINX a) $ code-server --auth none --bind-addr 127.0.0.1:8080 --verbose b) run nginx with follow minimal rule in /etc/nginx/sites-enabled/code-server server { listen 80 default_server; location / { proxy_pass 127.0.0.1:8080; } } c) open code-server page on particular address -> ERROR image

!! Im using NGINX to upgrade http to https on local domain, but this issue template does not allow "I am not using HTTPS."

Marekuss avatar Aug 21 '22 19:08 Marekuss

Thanks for opening a detailed issue! I haven't used NGINX much but I'm happy to try reproducing. Is using NGINX as simple as:

  • install globally
  • create config and run ?

If so, do you mind posting your NGINX config?

jsjoeio avatar Aug 22 '22 16:08 jsjoeio

His NGINX Config is posted just above the image, it's hard to see.

I think you should put ~ before /

server {
    listen 80;
    location ~ / {
        proxy_pass...
    }
}

tobycm avatar Oct 26 '22 10:10 tobycm

Closing for inactivity, but let us know if you still have problems.

code-asher avatar Mar 12 '24 19:03 code-asher