0

I have an Haproxy server and I need when the user type any_word.registro.myserver.com.br on the browser, the Haproxy redirect to https://app2.otherserver.com.br/register/**any_word**

The any_word is a captcha (*.registro.myserver.com.br)

Today I have the following redirect that doesn't forward:

acl fqdn_register_all hdr_dom(host) -i registro.myserver.com.br
redirect prefix https://app2.otherserver.com.br/register code 302 if fqdn_register_all

How should i change the above code?

Best regards

John
  • 343
  • 3
  • 10

1 Answers1

2

this rule should do the work:

acl fqdn_register hdr_dom(host) -i registro.myserver.com.br
capture request header Host len 128
redirect prefix https://app2.otherserver.com.br/register/%[capture.req.hdr(0)] code 302 if fqdn_register

hope it helps.

lu4t
  • 304
  • 2
  • 5
  • The rule above do not substitute the var and redirected the browser to: https://app2.otherserver.com.br/register/%[capture.req.hdr(0)]/ Any ideia? Best regards – John Jan 26 '23 at 20:44