I have a setup where I have servers like this:
load balancer -> Apache -> Tomcat
I would like Apache to write the url that the client used into a header, so I can read that once I hit tomcat.
I've tried to use mod_rewrite and mod_headers so do it, but with no luck. if I look at http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html then it seems clear that i need the variable called SCRIPT_URI:
SCRIPT_URI=http://en1.engelschall.com/u/rse/
I also looked at this http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html so figure out how to write headers and have had some succes, but not enough.
I have php installed on the apache server, and if i look at phpinfo() i can see the SCRIPT_URI is there and has a sensible value.
I just can't get it to write it to a header. Here's a simplified version of what I've done:
#load modules
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule headers_module modules/mod_headers.so
#Get the original uri used
RewriteRule .* - [E=INFO_SCRIPT_URI:%{SCRIPT_URI},NE]
RequestHeader set x-orig-uri "%{INFO_SCRIPT_URI}e"
I've tried several other options and both on windows, cygwin and ubuntu linux
Any ideas?