有2个前端express静态react应用,我们正在尝试将请求路由到那些服务。其中一个应该在root上可用,另一个应该在/ provider上可用。到/ provider的路由没有显示静态内容。它适用于/(根)。
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: example-gateway
namespace: default
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- hosts:
- example.com # frontend http
port:
name: http-example
number: 80
protocol: HTTP
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: frontend-service
namespace: default
spec:
hosts:
- example.com
gateways:
- example-gateway
http:
- name: frontend-default-route
match:
- uri:
exact: /
- uri:
prefix: /callback
- uri:
prefix: /static
- uri:
regex: '^.*\.(ico|png|jpg)$'
route:
- destination:
host: frontend-shopper-service.default.svc.cluster.local
port:
number: 9000
- name: frontend-provider-route
match:
- uri:
prefix: /provider
- uri:
prefix: /provider/callback
- uri:
prefix: /provider/static
- uri:
regex: '/provider/^.*\.(ico|png|jpg)$'
rewrite:
uri: /
route:
- destination:
host: frontend-provider-service.default.svc.cluster.local
port:
number: 9000
我们认为问题与/ provider / callback,/ provider / static和/provider/^.*.(ico|png|jpg)$有关。
答案 0 :(得分:0)
您是否收到类似400的错误消息,或者不显示是什么意思?