如何配置Spring Cloud Gateway服务器同时接受HTTP和HTTPS连接?
我在网关服务器上将SSL配置为端口443。我还希望在端口80上接受HTTP请求。我知道如何使用运行Tomcat的标准Spring Boot应用程序执行此操作,但我需要知道如何配置Gateway使用的Netty服务器。
发布于 2021-01-27 18:06:24
Spring CLoud网关文档展示了解决方案:7. TLS / SSL
网关路由可以路由到http和https后端。如果路由到https后端,则可以使用以下配置将网关配置为信任所有下游证书:
application.yml。
spring:
cloud:
gateway:
httpclient:
ssl:
useInsecureTrustManager: true发布于 2019-06-03 20:15:56
显然spring cloud gateway使用的webflux并不直接支持它,但有一些方法:How to configure in Spring Boot 2 (w/ WebFlux) two ports for HTTP and HTTPS?
还在等待一个真正的解决方案:https://github.com/spring-projects/spring-boot/issues/12035
https://stackoverflow.com/questions/55131927
复制相似问题