HAproxy-devel and http redirections

  • Hi

    I'm using HAproxy-devel and I am very happy with it.

    However i would really like to catch some URL's and redirect the clients to other pages. Is that possible? I can't see how I can do that with an ACL.

    Also, is i possible to make a "catch all" rule that redirects all URL's not specifically forwarded or redirected in other rules?


  • The acl's as made in the webgui dont currently support creating redirects.

    You can probably write the rules manually in the 'Advanced pass thru' section.

    It is a good idea though to add some kind of support for such a feature, ill put it on my list of things 'to investigate'. Dont have a clear idea about what it should look like though..

  • PiBa, i take it you are the guy doing the GUI and packaging of HAproxy-devel?

    Thank you for the excellent work!!!

    I don't know all the features HAproxy really delivers, but I think you should simply add a Redirect section that looks exactly like the ACL section and with the same rows, selectors and value fields + of course a field for the redirection destination.

    Finally I think that the last row in that section should be a "default" catch all redirector you can choose to activate if you want it to catch everything not specifically mentioned in the ACL's or REDIRECTORS above. If not activated, it should just behave like it does now when missing the ACL's

    Just as inspiration :-)

  • Correct i'm that guy ;)
    At least the one doing most of the changes in the current haproxy-devel package, 'compiling' the binaries is done by the servers of pfSense, i have to ask the core devs for a compile run when a new -dev version comes out. But other than that most changes to that package are done by myself.

    Yes something 'like' the current acl's will probably good. Next feature request will be for rewriting urls i suppose 8) .
    That should probably be implemented in 1 easy to use part of configuration, together with a option for redirects. Currently working on a few other parts which i first would like to finish.. (as you can see i have several pull requests waiting on GitHub.) So it will probably take some time before this is implemented in a 'nice' way.. (Also because it isn't at the top of my list.)

  • You sir, have my deepest respect.

    I shall await your next release in the most humble way possible  ;D

Log in to reply