haproxy 使用查询参数作为标头
我需要从查询字符串中读取一个参数,并使用一朵石南花。我尝试了几个选项,但似乎都不起作用。这是我的示例
--- 示例查询 ---
https://www. testdomain.com/something?param1=foo¶m2=bar
--ha-proxy frontend --frontend
lb_test
bind :443 ssl crt /etc/ssl/certs/mycert.pem
mode http
acl the_param2 { query -m sub -i param2= }
http-request add-header X-VALUE the_param2
use_backend lb_test 如果 the_param2
--- ha-proxy 后端 ---
后端 lb_test
balance roundrobin
server srv1 x.x.x.x:<port_number> check
提前致谢!
问候
I need to read one parameter from the query string and use is a heather. i tried a few option but none seems to work. Here is my example
--- sample query ---
https://www.testdomain.com/something?param1=foo¶m2=bar
--ha-proxy frontend --
frontend lb_test
bind :443 ssl crt /etc/ssl/certs/mycert.pem
mode http
acl the_param2 { query -m sub -i param2= }
http-request add-header X-VALUE the_param2
use_backend lb_test if the_param2
--- ha-proxy backend ---
backend lb_test
balance roundrobin
server srv1 x.x.x.x:<port_number> check
Thanks in advance!
regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
url_param
HTTP(第 7 层)获取来完成此操作,请参阅此处的文档。You can do it with the
url_param
HTTP (layer 7) fetch, see docs here.