nginx:
config :
location / {
add_header Content-Security-Policy upgrade-insecure-requests;
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host:$server_port;
proxy_set_header REMOTE_HOST $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Port $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
tomcat: server.xml, just add scheme="https" property,
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" scheme="https" />
标签:set,tomcat,header,nginx,add,proxy,https,scheme From: https://www.cnblogs.com/hualiu0/p/17448631.html