参考:https://www.cnblogs.com/phyger/p/14277685.html
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
name: aaa
namespace: default
annotations:
# 转发到service去掉前缀域名
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^/aaa/(.*)$ /$1 break;
spec:
rules:
- host: test.com
http:
paths:
- path: /aaa
backend:
serviceName: aaa
servicePort: 80
主要是这里
# 转发到service去掉前缀域名
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^/aaa/(.*)$ /$1 break;