Spring Cloud API网关部署在tomcat上后不工作
在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服务器访问它呢?
After deploying the gateway war file on tomcat not able to access it.
application.yml file setup
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
The above configuration works fine when I run it through the normal spring boot JAR file
Ex. http://localhost:9000/gateway/mysql/mysqlapi/test
when it deployed on the tomcat server that time I am not able to access it
Ex. Ex. http://localhost:8080/gateway/mysql/mysqlapi/test
So how can i access it from tomcat server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能,因为不支持 :
You can’t as it is not supported: