server {
listen 443 ssl;
listen [::]:443 ssl;
server_name nas.xxx.com;
# 前面组织的 ssl 证书文件全路径
ssl_certificate /volume1/DSM_NginxCustomConf/ssl_certificate/nas.xxx.com/nas.xxx.com.crt;
ssl_certificate_key /volume1/DSM_NginxCustomConf/ssl_certificate/nas.xxx.com/nas.xxx.com.key;
location / {
proxy_connect_timeout 60;
proxy_read_timeout 60;
proxy_send_timeout 60;
proxy_intercept_errors off;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
# 下面两行一定要添加,否则在DSM中 Virtual machine manager 连接虚拟机时提示noVNC“无法连线到伺服器”的问题
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X–Real–IP $remote_addr;
proxy_set_header X–Forwarded–For $proxy_add_x_forwarded_for;
proxy_set_header X–Forwarded–Proto $scheme;
proxy_pass https://群晖内网地址:5001;
}
# DS Photo 配置,默认使用的是本地 80 和 443 端口,此处使用 443 端口,即 https
location /photo {
proxy_pass https://群晖内网地址;
}
error_page 403 404 500 502 503 504 @error_page;
location @error_page {
root /usr/syno/share/nginx;
rewrite (.*) /error.html break;
allow all;
}
原文链接:http://lonhowe.cn/5447.html