Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
392 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 Reply

0 votes
by (71.8m points)

From further investigation,

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

does the job


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...