0

I have 1 haproxy server hosting for website.com and 1 nginx server hosting for static.website.com . I want when haproxy receive http request for http://website.com/static/image.jpg it will rewrite:

Host = website.com ==> Host=static.website.com

URI = /static/image.jpg ==> URI=/image.jpg

Then haproxy forward http request to nginx server, here

backend bk_nginx
  mode http
  # http-request replace-header if Host=website.com and URI=/static/image.jpg ==> rewrite them to Host=static.website.com and URI=/image.jpg
  server node1 nginx-server:83 # forward http request to nginx server port 83 with Host=static.website.com and URI=/image.jpg

Thank you very much for your help.

2
  • Do you want to change host and uri so the backend sees them that way or do you want to redirect them?
    – Izzy
    Oct 2, 2015 at 12:20
  • Hi GregL, I don't know how to configure haproxy to do this. Hi mkzero, I want to change host and uri so the backend sees them that way.
    – user36814
    Oct 5, 2015 at 2:12

0

You must log in to answer this question.

Browse other questions tagged .