code-server
code-server copied to clipboard
[Bug]: "File not found: ..." response when code-server is behind NGINX
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
- install code-server with YARN
- configure and run NGINX on port 80 with proxy_pass http://127.0.0.1:8080
- run: code-server --auth none --bind-addr 127.0.0.1:8080 --verbose
- 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
-
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

-
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
!! Im using NGINX to upgrade http to https on local domain, but this issue template does not allow "I am not using HTTPS."
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?
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...
}
}
Closing for inactivity, but let us know if you still have problems.