RewriteCond with HTTP_URL, but HTTP_URL not available

Topics: User Forum
May 24, 2013 at 2:37 PM
Edited May 24, 2013 at 7:24 PM
Hello,


I would like to use a subfolder like:

http://serv01/sqlserv02

to proxy ( and reverse proxy) to another server like:
http://sqlserv02/reports

Herefor I wrote this ini file with a rewritecond based on HTTP_URL.
RewriteCond %{HTTP_URL} =/sqlserv02/$1 [I]
RewriteEngine ON
RewriteLogLevel 4
RewriteLog C:\Inetpub\wwwroot\iirf_log33
StatusInquiry ON
RewriteBase OFF

ProxyPass       ^/(.*)$         http://sqlserv02:80/Reportserver/$
ProxyPassReverse    /sqlserv02      http://sqlserv02:80/Reportserver/
  • Windows 2003
  • IIS 6
  • iirf 2.1
With above ini file the log file returns ......=> "FALSE" when quering to the url.
Somehow this doesn't work.

Thereupon I tried it with {ALL_HTTP}. Just to see which http vars are available.
That cleared up a lot.

Logfile:

Fri May 24 14:26:25 - 7340 - ReplaceServerVariables: in='%{ALL_HTTP}' out='HTTP_CACHE_CONTROL:no-cache
HTTP_CONNECTION:keep-alive
HTTP_PRAGMA:no-cache
HTTP_CONTENT_LENGTH:81
HTTP_CONTENT_TYPE:application/x-java-serialized-object
HTTP_ACCEPT:application/x-java-serialized-object
HTTP_COOKIE:JSESSIONID=69223FFC65E3FC0CB87C75DEE23078CA; ASPSESSIONIDAASRSTBA=HNGFKLODFLJFLFHOBKDOAJGG
HTTP_HOST:SERV01
HTTP_USER_AGENT:Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_05
HTTP_METHOD:getNextResultSet

As you can see there is no HTTP_URL variable at all.

Hereupon I have tested the code also with next rewritecond:
RewriteCond %{HTTP_HOST} ^serv01$1 [I]
In this case the rewrite is made perfectly, so that means the proxy and reverse proxy everything works fine.

Now I want to make it work with submaps on:
serv01/x -> proxy and reverse proxy to anotherserver:8080
serv01/y -> proxy and reverse proxy to anotherserver:8181

Why is there no HTTP_URL? Is this some kind of setting somewhere in IIS?
How can I add this variable?
Or is there another way to work this out?