我来到这里,因为正如标题所示,我安装了代码服务器,除了我希望它在 apache2 下而不是在 nginx 下。我正在尝试在 https 下设置我的服务器,我已经有了我的证书,我只需要配置文件。我是一个初学者,所以我不了解有关 nginx 和代码服务器如何工作以及如何适应它的一切。我遵循了许多教程来执行此操作,并且配置文件始终相同:
server {
listen 80;
listen [::]:80;
server_name domainname.domain.dev;
location / {
proxy_pass http://localhost:8080/;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
}
在我必须设置服务文件之前:code-server.service:
[Unit]
Description=code-server
After=apache2.service #I changed this line before it was: nginx.service
[Service]
Type=simple
Environment=PASSWORD=code-server-password
ExecStart=/usr/bin/code-server --bind-addr 127.0.0.1:8080 --user-data-dir /var/lib/code-server --auth password
Restart=always
[Install]
WantedBy=multi-user.target
你能帮助我吗 ?我正在尝试找到解决此问题的方法,但我不知道该怎么做