我有一个运行在pod中的oauth2服务,需要用户向发送请求
http://[address]/oauth/token?grant_type=client_credentials&scope=[scope]
例如,当用户向提交请求时,使用下面的入口规则: http://address.com/oauth/token?grant_type=client_credentials&scope=[scope] 然后身份验证服务收到如下请求: http://address.com/token?grant_type=client_credentials&scope=[scope]
有什么办法解决这个问题吗?
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: gateway-ingress annotations: nginx.ingress.kubernetes.io/rewrite-target: / spec: rules: - host: address.com http: paths: - path: /oauth/* backend: serviceName: auth-service servicePort: 8052
我通过删除重写目标注释来解决这个问题。
我还必须删除/oauth之后的/*
我希望这能帮助其他人。