springmvc redirect 使用https后跳转到了http://域名:443问题处理

最近在处理一个很久之前的项目的时候,由于需要将http升级到https,导致springmvc项目中配置的redirect报错

线上的返回结果是http://abc.test.com:443/jrbac/mobile/wechat.html

通过nginx配置了一下解决了,记录一下

复制代码
location /jrbac {
        proxy_pass http://127.0.0.1:8080/jrbac;
	    proxy_redirect http:// $scheme://;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        client_max_body_size 10m;
        proxy_connect_timeout 60s;
        proxy_send_timeout 60s;
        proxy_read_timeout 60s;
        proxy_buffering off;
    }

最重要的是第二行配置proxy_redirect http:// $scheme://;

参考文献 https://www.php.cn/faq/320755.html

相关推荐
hsjkdhs2 小时前
网络编程之UDP广播与粘包问题
网络·网络协议·udp
00后程序员张3 小时前
详细解析苹果iOS应用上架到App Store的完整步骤与指南
android·ios·小程序·https·uni-app·iphone·webview
yzx9910134 小时前
接口协议全解析:从HTTP到gRPC,如何选择适合你的通信方案?
网络·人工智能·网络协议·flask·pygame
板鸭〈小号〉7 小时前
UDP-Server(3)chat聊天室
网络·网络协议·udp
weixin_4569042711 小时前
使用HTTPS 服务在浏览器端使用摄像头的方式解析
网络协议·http·https
不会叫的狼11 小时前
HTTPS + 域名 + 双向证书认证(下)
https
疯狂的维修15 小时前
关于Gateway configration studio软件配置网关
网络协议·c#·自动化·gateway
wow_DG15 小时前
【WebSocket✨】入门之旅(五):WebSocket 的安全性
网络·websocket·网络协议
拷贝码农卡卡东1 天前
pre-commit run --all-files 报错:http.client.RemoteDisconnected
网络·网络协议·http