location / {
proxy_pass http://127.0.0.1:8090;
proxy_set_header Host $host:$server_port; #有时候页面内局部URL丢失端口就这样写
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
#proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
#所有连接都升级为HTTPS
add_header Content-Security-Policy upgrade-insecure-requests;
}
nginx配置自动https,部分URL不带端口的问题
最新推荐文章于 2023-10-13 18:42:40 发布