I need to load balancing one of our customers application portal. The flow works as follow:
The enduser reach the portal through the URL example.net:3000/login page;
The enduser will choose one of four possible portal tenants each one with a dedicated custom port (example ports :3012, :3013, :3014, :3015);
Once the user managed to login the application automatically performs a path rewrite first into example.net:3000/auth/login (and manage the login) then redirect with a 302 status code into the path example.net:3000/redirect/, finally change the dedicated custom backend port and the user will enter the portal (example to example.net:3012).
I'm using HaProxy v2.4.22.
I've managed to perform the basic stuff such as usual HTTP to HTTPS redirect and add the /login path so I'm able to view the login page correctly.
About point 3 previously described, I would like to understand if is possible to catch the 302 status and redirect the flow to the correct backend.
I've tried also something like "http-request redirect location https://example.net:3000 code 302 if { status 302 } { path /redirect/ }" but the solution seems not working.
Any help would be very appreciated!
Thank you so much!