我想把SCDF的仪表板放在zuul后面(或者只是假设任何代理),但是当我这样做时,Spring Cloud Data Flow将重定向到它认为它的实际主机。
示例:Zuul是http://zuul/。它被配置为将任何/仪表板请求路由到http://scdf/host
在浏览器中,我去http://zuul/dashboard。
一旦请求通过zuul路由,然后命中SCDF,SCDF将重定向到http://scdfhost/dashboard,这将无法在锁定环境中工作。 (scdfhost不会透过外面看到)
我已经找到了可以在这里工作的任何属性,但我无法弄明白。
有人试过吗?还是提示?
谢谢你的提问!问题是将302
的http://localhost:9393/dashboard
重定向到仪表板的绝对URI(http://localhost:9393/dashboard/index.html)。如果您在代理服务器(例如Zuul)后面运行Spring Cloud Data Flow Server,则必须指定属性server.use-forward-headers
并将其设置为true
。这样Spring Boot就可以识别代理的HTTP转发头。另请参阅Spring Boot reference guide(“在前端代理服务器后面运行”)。
您可以在以下位置找到基本示例:
https://github.com/spring-cloud/spring-cloud-dataflow-samples/tree/master/dataflow-zuul
为了澄清参考文档,我创建了一个后续问题:
https://github.com/spring-cloud/spring-cloud-dataflow/issues/2929