首页 > 解决方案 > 将 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 获取请求。

我感谢你的帮助,

艾伦

标签: nginxproxykeycloak

解决方案


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.


推荐阅读