Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If you go to www.company.com, I want it to redirect to /something/something on my server, but the URL still shows www.company.com Is this possible in haproxy?

backend new_marketing_server
  *** set default URL to /something/something***    
  mode http
  balance roundrobin
  timeout server 10m
  option httpclose
  server server1 10.86.151.142:80 minconn 32000 maxconn 3200 check port 80 inter 2000
  server server2 10.122.13.189:80 minconn 32000 maxconn 3200 check port 80 inter 2000
share|improve this question
add comment

2 Answers

Yes it's doable: add the line below in your backend

reqrep ^([^\ ]*)\ /(.*)     \1\ /something/something/\2
share|improve this answer
add comment

Yes, this can be done at the level of load balancer such as haproxy (not recommended) and can be done also (recommended) on the web server level. This is because your setup should work with/without load balancer without changing your backend servers config.

If you are using apache or nginx, you can use rewrite rules to change the requested URL

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.