RewriteHeader Question

Topics: Developer Forum, Project Management Forum, User Forum
Oct 7, 2010 at 12:50 AM

I have a rule where I am trying to pass multiple headers...

When I examine the variables that iirf passed over to the server that is being proxied, it only seems to receive the value for the first rewriteheader that is encountered before the proxypass occurs.

For example...

RewriteHeader x-myvar:   someval
RewriteHeader x-myvar2:  someval2
Proxypass ....

When I test for http-x-myvar  I see someval is passed over correctly
When I test for http-x-myvar2 I don't see that header and no value is passed over as well...

Should this work?

If it should work, can someone post a sample rule for me to test with...


Oct 11, 2010 at 12:24 PM
What you are trying to do should work. Unfortunately, you're not th first person to report having troubles accomplishing it.

There may be a problem in iirf code, or it may be a misunderstanding or a mis-application of the iirf rules processing logic. Examining the iirf logfile for a single request should shed some light on the situation. Can you post yours?
Oct 12, 2010 at 8:31 PM

I turned logging on to level 5.

I validated the first variable gets set - see entry from the log file

Sun Oct 10 13:16:51 -  6276 - GenProxyRequestHeadersString: header XMYVAR: someval

But you'll notice the next entry in the log is the ProxyRequest...  So it skips completely over the second RewriteHeader rule and goes straight to the Proxypass... 

Sun Oct 10 13:16:51 -  6276 - ProxyRequest: WinHttpConnect 80

Here's the contents of the iirf.ini file

RewriteLog c:\inetpub\wwwroot\iirf
RewriteLogLevel 5
StatusInquiry ON RemoteOk
IterationLimit 10
RewriteHeader XMYVAR1 ^$  someval
RewriteHeader XMYVAR2 ^$  someval2
ProxyPass ^/test*  [I]

*** If I comment out the first RewriteHeader and leave the second one there, it processes that one fine...

Oct 14, 2010 at 10:43 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jan 7, 2011 at 11:33 AM

This is now fixed in v2.1.1.25.  Thanks for reporting it.