网站首页 > 技术教程 正文
背景
公司全部网站需要支持 HTTPS 协议,在阿里云负载均衡配置 SSL 证书后,导致 Nexus 的 HTTPS 访问出错。
网站访问路径: 域名解析到阿里云的负载均衡,负载均衡配置 80 端口强转 443 端口,443 端口配置 SSL 证书,并转发到内网 nginx,内网的 nginx 再代理 Nexus 服务。
解决
浏览器 HTTPS 访问 Nexus 的 Console 报错信息:
报错信息大致意思是:HTTPS 访问的页面上不允许出现 HTTP 请求。
解决方法: 在 nginx 配置文件增加 “proxy_set_header X-Forwarded-Proto https;” ,这样 nginx 在转发时就使用 HTTPS 协议。
nginx.conf 中的 nexus 配置内容:
location ^~ /nexus {
proxy_pass http://x.x.x.x:8080/nexus;
sendfile off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https; # 转发时使用https协议
proxy_max_temp_file_size 0;
# This is the maximum upload size
client_max_body_size 20m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_temp_file_write_size 64k;
# Required for new HTTP-based CLI
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_buffering off; # Required for HTTP-based CLI to work over SSL
}
猜你喜欢
- 2024-10-15 WordPress Docker Compose部署云服务器Nginx代理HTTPS证书本地备份
- 2024-10-15 为GrayLog Web接口配置nginx HTTPS/SSL反向代理
- 2024-10-15 服务器开发程序员必须搞清HTTPS通讯之证书
- 2024-10-15 HummerRisk配置HTTPS访问教程(hummerrisk配置https访问教程最新)
- 2024-10-07 分享一款轻量级 HTTP(S) 代理 TinyProxy
- 2024-10-07 linux和nginx,https配置实战精辟总结
- 2024-10-07 不要再羡慕别人,你也可以免费拥有HTTPS网站
- 2024-10-07 HTTPS代理在大数据时代的性能与安全优化
- 2024-10-07 82.怎么免费试用https(开始菜单pro免费试用已到期怎么解决)
- 2024-10-07 宝塔配置HTTPS后 nginx 反向代理出现 502 Bad Gateway
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)