I've got a website that I want to always be served in https. The site is load balanced using Apache.
The Apache load balancer is configured basically like so:
<Proxy balancer://mycluster>
BalancerMember http://server1 route=server1
BalancerMember http://server2 route=server2
</Proxy>
Note that all http requests are being rewritten to https requests fine using mod rewrite as well.
The thing I'd like to do is ensure that any http 302 Location headers from server 1 or server 2 are rewritten and sent as https 302 redirect headers.
e.g.
If a response from server 1 had the following as a header:
Location: http://server1/test
I'd like it to be rewritten securely as
Location: https://server1/test
This would avoid the request being sent to the client, and the client then sending the http request, which gets rewritten to https, and would also avoid any security issues of responses being sent over http.
How can I do this?