IIS 7 and Above
Application Request Routing (ARR)
Remove the "X-Original-URL:" header from ARR request
Last post Sep 17, 2020 05:59 PM by skwayb
Feb 18, 2014 09:40 AM|nayak123|LINK
Could you please help me with below Query.
The ARR proxy adds the "X-Original-URL:" header (populating it with same value as the original url request) when forwarding the request to the backend server. How to remove this header from the proxy request ? (or set any other value say "dummy" to this
header if removing is not possible).
Feb 18, 2014 01:21 PM|raghunath1|LINK
The problem I am facing is that, the url requests are very long as it contains many parameters in the query string and the same is duplicated in the "X-Original-URL:" header and want to avoid that. Any kind replies would be helpful.
Feb 19, 2014 11:59 PM|DropPhone|LINK
Actually, X-Original-URL was added by the URL Rewrite module.
And, no, you can't remove it. Not easily, anyway...
Feb 20, 2014 02:56 AM|nayak123|LINK
Yes, I tried to add server variable "HTTP_X_Original_URL" with blank value in the rewrite rule but it is not working. Thanks for your reply.
Feb 20, 2014 10:59 AM|DropPhone|LINK
I think it's case sensitive, so HTTP_X_ORIGINAL_URL.
And, I just tried this on my box, and I was able to set the HTTP_X_ORIGINAL_URL to something else. I couldn't make it blank, but I could overwrite it to 'x'.
The trick is to allow the HTTP_X_ORIGINAL_URL header. In the URL Rewrite applette, on the left-hand pane, select "View Server Variables...". If you don't see HTTP_X_ORIGINAL_URL listed, select "Add..." and add the server variable. Then you can go back
and use it in your rule.
Pro tip: make this rule *last* in your list, and select "Stop processing more rules" after it. That should prevent another rule from triggering the addition of HTTP_X_ORIGINAL_URL again.
Feb 21, 2014 02:55 AM|nayak123|LINK
Thanks for your reply.
I have only one inbound rewrite rule (at machine level and nothing at site level) that routes the incoming request to the server farm. I added the server vaiable "HTTP_X_ORIGINAL_URL" to the allowed list at machine level and set the variable to "x" in this
inbound rule. But it is still not working for me. Am I missing something?
Feb 21, 2014 07:13 PM|DropPhone|LINK
Hm. Sounds like you configured things correctly. I'll have to try this config in my system to see if I can repro your issue.
Mar 19, 2014 06:42 AM|nayak123|LINK
The url rewrite module adds the "X-Original-URL:" header which has the original request. Is it possible to remove this header or assign some custom value to this header.
Sep 17, 2020 05:55 PM|skwayb|LINK
At the Server Level off IIS if you go to the Configuration Editor, then system.webServer/proxy setting. Set the StealthMode to TRUE and it will stop sending the X-ORIGINAL-URL in the header.
Sep 17, 2020 05:59 PM|skwayb|LINK