nginx - 将 nginx 代理到另一个 nginx,然后再到应用程序
问题描述
我有以下设置。
网络 A Nginx / SSL
Network B App1/preprod(keycloak preprod、wildfly preprod、database preprod)
网络 C Nginx /SSL
Network D App1/test(keycloak测试、wildflys测试、数据库测试)
沟通:
A <-> B
A <-> C
C <-> D
我在尝试着:
NGINX A -> APP 1 preprod --- that is ok
NGINX A -> NGINX C -> APP 1 test --- that's what i am tryng to figure out.
问题是 APP1 测试中的 keycloak 需要从 NGINX A URL 而不是 NGINX C 获取请求。
我感谢你的帮助,
艾伦
解决方案
It's little bit difficult to understand actual problem here.
I assume you should dig into http headers while passing through nginx. You could pass same Host header even hostname does not resolve to Nginx C. Just use upstream in proxy_pass and set proxy_set_header Host parameter with desired value.
推荐阅读
- node.js - 具有版本控制的节点模块(代码共享)
- mysql - 如何在 mySQL 中将行转换为列
- mysql - Mysql 不返回插入行的正确 id
- javascript - Toolip Qtip 与谷歌图表表
- excel - powershell脚本超时
- angular - Angular 在组件使用中包含 CDN
- bash - 递归重命名文件和替换字符
- swift - 有没有办法根据最终都可以由特定类型表示的参数类型来简化这个“重载矩阵”?
- android - Android App 查看上传到云存储的图片
- php - AWS S3 使用 PHP 开发工具包上传到法兰克福地区 - 访问被拒绝错误