如上图所示,不希望在 url 里显示 :443
1
AllenHua OP nginx 反代配置如下
``` server { listen 443 ssl http2; port_in_redirect off; server_name example.com; proxy_set_header X-Forwarded-For $remote_addr; proxy_ssl_server_name on; server_tokens off; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; ssl_session_timeout 10m; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; location / { proxy_pass http://127.0.0.1:8082; 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; proxy_set_header X-Forwarded-Host $server_name; proxy_read_timeout 1200s; proxy_ssl_server_name on; proxy_set_header X-Forwarded-Proto $scheme; # used for view/edit office file via Office Online Server client_max_body_size 64m; } access_log /var/log/nginx/example-service.access.log; error_log /var/log/nginx/example-service.error.log; } ``` |
2
AllenHua OP 解决了……
`location /` 块里 proxy_set_header Host $host:$server_port; 上面这一行改成 proxy_set_header Host $host; 然后 `nginx -t`、`nginx -s reload` 再测试就没有了 此帖终结 |
3
cruzzz 2021-07-31 14:16:25 +08:00 1
6666 真是不错的人,还附带上了解决方案。
|