Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
403 views
in Technique[技术] by (71.8m points)

devops - Configure `:path` header for envoy ratelimiting

I'm trying to use envoy ratelimiting functionality and need to ratelimit based on the entire url in my request, e.g. https://myenvoy.com/path/to/smth

Here is a part of my envoy.yaml

routes:
                - match: { prefix: "/" }
                  route: 
                    cluster: backend
                    rate_limits:
                      - stage: 0
                        actions:
                          - {request_headers: {header_name: ":path", descriptor_key: "path"}}

When I run

curl -k https://myenvoy.com/path/to/smth

The above configuration creates descriptor value /path/to/smth whereas I would like to have descriptor of value https://myenvoy.com/path/to/smth

Is it possible to configure that with envoy?

Thank you

PS: I looked at these header values and tried to use some, but it didn't help https://github.com/envoyproxy/envoy/blob/master/source/common/http/headers.h

question from:https://stackoverflow.com/questions/65646376/configure-path-header-for-envoy-ratelimiting

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

From further investigation,

 - {request_headers: {header_name: "host", descriptor_key: "host"}}

does the job


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...