: Using mod_rewrite to force users to use our caching proxy During a recent audit we became aware of several users who have not set their DNS records to correctly point to our name servers.
During a recent audit we became aware of several users who have not set their DNS records to correctly point to our name servers.
Since we don't control the domain names of our users directly, we're not exactly sure what they've done wrong. All we know is that their users are hitting our origin server, not our caching proxy.
I would like to use Apache's mod_rewrite in the vhosts configs of affected users to redirect users to our caching proxy if they are not coming from it already. I envision something like this:
RewriteCond %{REMOTE_ADDR} !^PROXY.SERVER.IP.ADDRESS$
RewriteRule "^/?(.*)" "http://PROXY.SERVER.IP.ADDRESS/"
However, this won't preserve the client's HTTP host header. Is there a sensible way to do this that will preserve the client's HTTP host header?
More posts by @Nimeshi995
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.