It works, but I initially made a typo error (teste2 instead test2) on the redirect location URL.
So now everything is redirected to my url with the typo error.
I tried to change my redirect URL, but URL is still redirecting to my old url
I guess there is a cache inside haproxy ? (I tried to change my browser and clear the cache in case cache is also on this side, but no chance)
FYI, when I curl my url:
< HTTP/1.1 301 Moved Permanently
< location: https://teste2.server.com
The code is optional. It indicates which type of HTTP redirection
is desired. Only codes 301, 302, 303, 307 and 308 are supported,
with 302 used by default if no code is specified. 301 means
"Moved permanently", and a browser may cache the Location. 302
means "Moved temporarily" and means that the browser should not
cache the redirection.
In this case it’s likely that the haproxy instance running the old configuration is still running and accepting requests, because in this case the kernel load balances between the old and new process, so that is why the result is inconsistent.
Stop haproxy completely, and then check if there are still haproxy processes running. Kill them all and start haproxy again.