[Resolved] HAP/Docker/NAS redirecting not proxying

Hi,

I’ve set up a Haproxy docker container with the latest version 1.7 on my NAS Synology.
The docker configuration seems ok, unless there is some unexpected behavior.

It’s my first time trying to make a Haproxy, I may miss some things.
With my minimalist configuration :

defaults
		mode http
frontend front 
		bind *:5036
		option forwardfor
		use_backend box

backend box
		server box ip_server

When i navigate through “http:/ /ip_Haproxy:5036” i’m redirected to "http:/ /ip_server/"
My trouble is i don’t want my client to be redirected, i want to see the “http:/ /ip_server/” web page through the frontend of Haproxy, with the “http:/ /ip_Haproxy:5036” url in the client browser

According to everything i read, it seemed to me that’s proxying is the basic functionnality of Haproxy, but I don’t even success to do so. Is there something i’m missing ? Is that the configuration or Haproxy simply doesn’t do this ?
Or everything should be ok and it’s more on the end of Docker / DSM i need to look ?

1 Like

Your backend is redirecting. Maybe you can disable that in your DSM settings?

Otherwise you will probably have to rewrite the Host header, so that DSM doesn’t trigger a redirect.

Toh ! Indeed, when my host header isn’t what it’s defined, my backend redirect 302 to its “good” host… which is a IP address…
That’s sneaky.

Thanks a lot, I’ll practice Haproxy on a backend more friendly ^^