akalittle commented on issue #1208:
URL:
https://github.com/apache/apisix-ingress-controller/issues/1208#issuecomment-1204673384
Hey, the yaml above of mine is to explain:
I have a service proxy all `/status/*` to the service
However, I just want to expose `/status/metrics` to public without keyauth.
Can I finish this in one yaml config ?
I've tried to seperate this to two file
```
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: status-tracker
namespace: launcher
spec:
http:
- name: status-tracker-rule
match:
hosts:
- api.xxx.cc
paths:
- /status-tracker*
plugins:
- name: proxy-rewrite
enable: true
config:
regex_uri:
- ^/status-tracker/(.*)
- /$1
backends:
- serviceName: status-tracker
servicePort: 8000
authentication:
enable: true
type: keyAuth
keyAuth:
header: Authentication
```
```
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: status-tracker-public
namespace: launcher
spec:
http:
- name: status-tracker-public
match:
hosts:
- api.xxx.cc
paths:
- /status-tracker/metrics
plugins:
- name: proxy-rewrite
enable: true
config:
uri: /metrics
- name: public-api
enable: true
backends:
- serviceName: status-tracker
servicePort: 8000
authentication:
enable: false
```
But when I visit `api.xxx.cc/status-tracker/metrics`
It also responsed `{"message":"Missing API key found in request"}`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]