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 currently have a line in our HAProxy config that I uncomment when I want to put the site into 'maintenance mode'. It just redirects requests not for the static subdomain to a maintenance page.

redirect location http://static.site.com/maintenance.htm unless { hdr(host) -i static.site.com }

Of course, this is is a 30x type redirect, so a new http request, and the user sees the url change.

I'd prefer to simply rewrite the request to another url (so the original url does not change in the browser), but can't work out how to do this. I've tried experimenting with reqirep, but perhaps my regex-fu is not up to scratch.

Can anyone suggest a solution? Thanks

share|improve this question

1 Answer 1

The following rule should suffice:

reqirep ^.* http://static.site.com/maintenance.htm


share|improve this answer

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.