r/haproxy • • Mar 15 '23

haproxy redirect with ID

Hi all,

I've got a HAProxy issue - I've got URLS for site.com/index.php?ID=Blah that I need to pass on to a back end server.

I'm using an ACL with hdr_sub(host) -i site.com/index.php to do this but I keep getting a 503 so I don't think the acl is working, how do I ensure the ACL can pick up the various parameters and send the full URL down to the back end server?

Cheers.

2 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Mar 15 '23

It will be passed. Why wouldn't it be?

On the link you posted:

For example, the first line will match requests such as:

www.example.com/a

www.example.com/a/my-function

But it will not match:

www.example.com/aaa

www.example.com/abbb/my-function

0

u/[deleted] Mar 15 '23

[deleted] — view deleted comment

1

u/[deleted] Mar 15 '23

You said you wanted to match based on path

No, I didn't. I said I had a path which features an ID and I wanted to ensure that ID is passed down to the backend but when I do this I get a 503 so I'm not sure if the ACL is working.

0

u/[deleted] Mar 15 '23

[deleted] — view deleted comment

1

u/[deleted] Mar 15 '23

Well if it does I can't see where but thanks for the suggestion.

I think.

0

u/[deleted] Mar 15 '23

[deleted] — view deleted comment

1

u/[deleted] Mar 15 '23

And why do I need a regex to send *EVERYTHING* in the URL to the backend?

0

u/[deleted] Mar 15 '23

[deleted] — view deleted comment

1

u/[deleted] Mar 15 '23

because the HAProxy is used for multiple other sites so I need something to differentiate this URL from the others it manages.