在tomcat上部署網關war檔案后無法訪問它。
application.yml 檔案設定
server:
port: 9000
servlet:
context-path: /gateway
spring:
cloud:
gateway:
routes:
- id: mysqlservice
uri: http://localhost:8080
predicates:
- Path= /gateway/mysql/**
filters:
- StripPrefix=1
- id: xyzservice
uri: http://localhost:8080
predicates:
- Path= /gateway/xyz/**
filters:
- StripPrefix=1
- id: lightservice
uri: http://localhost:8080
predicates:
- Path= /gateway/light/**
filters:
- StripPrefix=1
當我通過普通的 spring boot JAR檔案運行時,上面的配置作業正常
前任。http://localhost:9000/gateway/mysql/mysqlapi/test
當它部署在tomcat服務器上時,我無法訪問它
前任。前任。http://localhost:8080/gateway/mysql/mysqlapi/test
那么如何從tomcat服務器訪問它呢?
uj5u.com熱心網友回復:
你不能因為它不受支持:
Spring Cloud Gateway 需要 Spring Boot 和 Spring Webflux 提供的 Netty 運行時。它不適用于傳統的 Servlet 容器或構建為 WAR 時。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/440621.html
