暗中观察

nginx https 相关问题
一、 java后端spring boot 获取requestURL()后,https变为了http!解决: l...
扫描右侧二维码阅读全文
18
2019/07

nginx https 相关问题

一、 java后端spring boot 获取requestURL()后,https变为了http!

解决:

   location / {
        proxy_pass http://127.0.0.1:9001;
        proxy_set_header X-Forwarded-Schema https;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $clientRealip;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
   
   spring boot 配置 server.tomcat.protocol_header=x-forwarded-proto

二、 nginx ssl后,java redirect 后,变为了http请求!

解决:

    在nginx server内加入 proxy_redirect http:// https://;
Last modification:July 18th, 2019 at 06:46 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment