X-Sendfile's new friend: X-Rewrite-*
Today on IRC I got a question on:
Fobax can you x-send-file from fast-cgi to a proxy request?
Or asked in another way:
Can you use a mod_proxy_core backend to rewrite a URL or a Host header?
After 30 minutes of coding… Yes, you can …
Some tweaking and here and there and we had:
which allows you to send:
as response and lighty will replace both values and the original request and start the whole request from scratch. Here I rewrite the incoming request to use another internal Host and a new URI.
What is this good for?¶
- rewriting
http://user.example.org/tohttp://xample.org/~user/ - denying access to host with unwanted content based on the Hostname
- filtering in general
Do you have other examples?