I have a setup where I have these servers:
load balancer -> Apache -> Tomcat
I would like Apache to write down the URL that the client used in the header, so I can read as soon as I click on tomcat.
I tried to use mod_rewrite and mod_headers, so I do this, but 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 SCRIPT_URI variable:
SCRIPT_URI=http://en1.engelschall.com/u/rse/
I also looked at this http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html to figure out how to write headings and have some success, but not enough.
I have php installed on the apache server, and if I look at phpinfo (), I see that SCRIPT_URI is and has a reasonable value.
I just can't get him to write it in the header. Here is a simplified version of what I did:
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule headers_module modules/mod_headers.so
RewriteRule .* - [E=INFO_SCRIPT_URI:%{SCRIPT_URI},NE]
RequestHeader set x-orig-uri "%{INFO_SCRIPT_URI}e"
I tried several other options, both on windows, cygwin, and ubuntu linux
Any ideas?
source
share