You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
server {
listen 80 default_server;
listen [::]:80 default_server;
#redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}
反向代理部分 很重要
server {
listen 443ssl http2; #443就是开放的https端口
listen [::]:443ssl http2;
# 常规的ssl证书配置
# certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
ssl_certificate /nginx-1.17.5/path/to/???????.crt;
ssl_certificate_key /nginx-1.17.5/path/to/???????.key;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
# dhparam 设置 如果不清楚就注释掉
# curl https://ssl-config.mozilla.org/ffdhe2048.txt > /path/to/dhparam.pem
ssl_dhparam /nginx-1.17.5/path/to/dhparam.pem;
# 推荐安全配置
# intermediate configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
# OCSP stapling
ssl_stapling on;
ssl_stapling_verify on;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /nginx-1.17.5/path/to/TrustAsiaTLSECCCA.crt;
# replace with the IP address of your resolver
resolver 223.5.5.5 223.6.6.6 114.114.114.114 valid=3600s;
#向上游服务器传变量
#核心转发 第一步 反向代理web服务
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-F $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:23333; # 这里要填写本地面板地址
}
#核心转发 第而步 反向代理websocket服务
location /websocket/ws {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-F $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:23333/websocket/ws; # 这里要填写本地面板websocket地址
}
}
看到教程里面提到的实现ssl 的nginx部分说的不太详细 尽我所能补充下
第一 nginx反向代理配置
默认http端口为80 ssl端口为443
这部分是http强制重定向到https(443) 看你自己需要不需要
反向代理部分 很重要
第二 public\common\URL.js里面需要修改 参考以下范本
这个修改说明仅限当前版本(8.5.8)
有那位大佬帮我优化下排版呗。。。。。。。这个排版真难用
The text was updated successfully, but these errors were encountered: