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

I have a custom app behind an haproxy server. Can haproxy rewrite the case of the header?

For example changing http://www.company.com/ABC to http://www.company.com/abc

If so, how?

share|improve this question

1 Answer 1

You can handle this easily enough:

reqrep ^([^\ ]*)\ /ABC(.*)     \1\ /abc\2

However, it is usually more appropriate to handle URL rewrites on the web server (e.g. mod_rewrite), so I would use these type of rewrites sparingly.

share|improve this answer
What if I don't know what the string will be? Is it still possible to do the replace? –  Magd Mar 9 '12 at 0:34
For example, I can't predict if it will be company.com/TEST, company.com/ABC, company.com/DOG, company.com/WHAT/EVER. –  Magd Mar 9 '12 at 0:55
As far as I know, HAProxy cannot transform URLs using a function like that. You'll likely find it easier using rewrite rules in IIS or Apache to solve this issue. –  Matt Beckman Mar 9 '12 at 1:46

Your Answer


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.