Modify requested URL

Started by heribert, July 25, 2021, 07:36:50 PM

Previous topic - Next topic
Dear all,

I'm running haproxy on an opnsense system, which works fine.As one backend I'm using xwiki. This system is on part 8080.
All is working fine to have access through the frontend with https//wiki.mydomian.com.
All http request are redirected to https (443) . Also the ssl certificate is properly in place

However there is one strange thing: In the case the user has forgotten the password he gets an email after filling like this
https://wiki.mydomain.com:80/bin/view/XWiki/ResetPasswordComplete?u= ...
The strange thing is the https at the beginning, which is correct and the port :80 at the end.

The browser reports an error like : SSL_ERROR_RX_RECORD_TOO_LONG

If I manually delte the ":80" from the link all is working fine.

How can I modify/rewrite the requested url and delete the :80

Any help is appreciated

This worked for me:
In the frontend (advanced mode) oh HAProxy in the section Option pass-through
add:
http-request replace-value Host (.*):80 \1:443