code-server
我正在尝试在 Ubuntu 22.04 上进行设置。我已经安装code-server
并可以成功登录,但是一旦我登录,我只能看到一个空白屏幕。查看nginx
错误日志显示以下内容。
请注意,当我从浏览器导航到错误日志中指示的位置时,对象加载正常。这让我相信我的nginx
配置存在某种错误。
2023/09/12 09:26:28 [error] 1956#1956: *60 upstream prematurely closed connection while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: code.mydomain.com, request: "GET /stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/code/browser/workbench/workbench.js HTTP/1.1", upstream: "http://127.0.0.1:8080/stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/code/browser/workbench/workbench.js", host: "code.mydomain.com", referrer: "http://code.mydomain.com/"
2023/09/12 09:26:28 [error] 1955#1955: *50 upstream prematurely closed connection while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: code.mydomain.com, request: "GET /stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/loader.js HTTP/1.1", upstream: "http://127.0.0.1:8080/stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/loader.js", host: "code.mydomain.com", referrer: "http://code.mydomain.com/"
2023/09/12 09:26:28 [error] 1956#1956: *57 upstream prematurely closed connection while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: code.mydomain.com, request: "GET /stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/workbench/workbench.web.main.js HTTP/1.1", upstream: "http://127.0.0.1:8080/stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/workbench/workbench.web.main.js", host: "code.mydomain.com", referrer: "http://code.mydomain.com/"
2023/09/12 09:26:28 [error] 1956#1956: *55 upstream prematurely closed connection while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: code.mydomain.com, request: "GET /stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/workbench/workbench.web.main.nls.js HTTP/1.1", upstream: "http://127.0.0.1:8080/stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/workbench/workbench.web.main.nls.js", host: "code.mydomain.com", referrer: "http://code.mydomain.com/"
2023/09/12 09:26:28 [error] 1956#1956: *54 upstream prematurely closed connection while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: code.mydomain.com, request: "GET /stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/webPackagePaths.js HTTP/1.1", upstream: "http://127.0.0.1:8080/stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/webPackagePaths.js", host: "code.mydomain.com", referrer: "http://code.mydomain.com/"
2023/09/12 09:26:28 [error] 1956#1956: *49 upstream prematurely closed connection while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: code.mydomain.com, request: "GET /stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/workbench/workbench.web.main.css HTTP/1.1", upstream: "http://127.0.0.1:8080/stable-2ccd690cbff1569e4a83d7c43d45101f817401dc/static/out/vs/workbench/workbench.web.main.css", host: "code.mydomain.com", referrer: "http://code.mydomain.com/"
2023/09/12 09:26:28 [error] 1956#1956: *49 connect() failed (111: Unknown error) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: code.mydomain.com, request: "GET /_static/src/browser/media/favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/_static/src/browser/media/favicon.ico", host: "code.mydomain.com", referrer: "http://code.mydomain.com/"
2023/09/12 09:26:28 [error] 1956#1956: *49 connect() failed (111: Unknown error) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: code.mydomain.com, request: "GET /_static/src/browser/media/favicon-dark-support.svg HTTP/1.1", upstream: "http://127.0.0.1:8080/_static/src/browser/media/favicon-dark-support.svg", host: "code.mydomain.com", referrer: "http://code.mydomain.com/"
要安装和配置code-server
和nginx
,我按照本指南。
还请注意,由于我的业务限制,我无法使用certbot
上述指南中所述的方法来生成 SSL 证书,因此我只能通过 HTTP 运行。这是否意味着我的nginx
配置现在不正确?
有人能指出问题可能是什么以及我该如何解决这个问题吗?
nginx
会议
server {
listen 80;
listen [::]:80;
server_name code.mydomain.com;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
}