0

Currently I am using this partial config to direct the user to a different server if the url has a string in it:

    acl olay1 url_sub token
    acl olay2 url_sub alert
    acl olay3 url_sub alarm
    use-server node1 if olay1 or olay2 or olay3

this normally works when i trigger the url from the browser but , from my app ,t doesn't work because I am using http POST method to post the url to my server. And when the method is post , haproxy is not able to see the url string completely because post method hides the variable after ? like www.example.com/a.php?action=tokensave

Is there a way to make haproxy's config work with the post method for url_sub ?

Thank you.

  • Hi and welcome to SO. I am a bit confused why haproxy should not be able to read the query string *(url?query=1&...)*, when the request method is POST. Which version of haproxy do you use? If it is the latest (v1.8), some predefined ACLs may help you: https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#7.4 So it should be possible to make an ACL for method POST only. – BenRoob Aug 22 '18 at 11:47
  • Okay, it is possible. Almost an exact duplicate of your problem ;) Hope this helps: https://stackoverflow.com/questions/5673335/how-to-configure-haproxy-to-send-get-and-post-http-requests-to-two-different-app – BenRoob Aug 22 '18 at 11:50

0 Answers0