PVE配置nginx代理访问。
nginx配置:
server {
listen 10101 ssl;
server_name pve.ok.top;
#ssl on;
#从腾讯云获取到的第一个文件的全路径
ssl_certificate conf.d/ssl/cert.pem;
#从腾讯云获取到的第二个文件的全路径
ssl_certificate_key conf.d/ssl/key.pem;
location / {
# 非默认端口需要添加$server_port
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 转发时使用https协议
proxy_set_header X-Forwarded-Proto https;
proxy_redirect http:// https://;
#下面三项为websocket代理配置,必须,否则pve noVNC无法连接
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
proxy_pass https://192.168.1.119:8006;
}
}
特别注意,以下三行必须配置,否则无法访问控制台:
#下面三项为websocket代理配置,必须,否则pve noVNC无法连接
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
https://www.leftso.com/article/1078.html