1
jifengg 2020-11-18 11:00:32 +08:00
你这不管三七二十一全部 return 301,能不重定向次数过多吗?
我一个服务器是这么设置的: #设置域名跳转 https server{ listen 80; server_name www.example.com; return 301 https://$host$request_uri; } 80 和 443 端口监听分开,简单易懂 |
2
WeKeey 2020-11-18 11:10:13 +08:00
server {
listen 80; server_name xxx.xyz; return 301 https://xxx.xyz$request_uri; } server { listen 443 ssl; server_name xxx.xyz; ssl_certificate cert/xyz.xxx.crt; ssl_certificate_key cert/xyz.xxx.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; location / { proxy_pass http://zzz; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } access_log /var/log/nginx/xxx.access.log; } |
4
quanjw 2020-11-18 13:32:23 +08:00
你试试 497 状态码? 但是 我好像不行 也没找到原因、、、
|