Rewrite from domain to different ip and hide the ip


#1

Hi there this is my frist post in this forum. I´m new to haproxy and need some help setting up a special configuration, maybe you can help me with some configuration hints.

I have a server running a cloud service. On the same device is haproxy. The server has a static ip, say 11.22.33.44 and the cloud service is in a subfolder /cloud. So you can reach the cloud service under 11.22.33.44/cloud.

I own a domain at a different provider with the name for example: elluminatus.xy
And also a subdomain exist like: cloud.elluminatus.xy

So now i want to hide 11.22.33.44/cloud in the browser when I redirect from

cloud.elluminatus.xy -> 11.22.33.44/cloud

I want always the cloud.elluminatus.xy in the browser window.

Is this possible and how can I implement this, I think I have to do a rewrite rule, right? But how can I fix this?

Beste greetings and thank you for your help!

Elluminatus


#2

To rewrite / to /cloud:
reqrep ^([^\ :]*)\ /\ (.*) \1\ /cloud\ \2

To set the Host header to 11.22.33.44, in the backend configure:
http-request set-header Host 11.22.33.44