0

In IIS 8.5 I am using URL rewrite to forward the request to an external server (in server farm). The problem is that rewrite is adding the Host header to the request to the external server, which is causing that server to respond with an error. Testing manually with Postman, I can see that if I send a request to the external server with a Host header, I get the same error (even if value is blank). Removing the Host header will give a successful response.

How do I remove the Host header from the forwarded request to the external server?

I've seen questions and answers regarding removing the headers from the response. However these either are not applicable or dont work with respect to forwarded request headers.

Matt
  • 101
  • 3
  • 1
    The `Host:` header has been mandatory since 1999 when [RFC 2616](https://www.ietf.org/rfc/rfc2616.txt) defined HTTP 1.1 ... If *"the presence of the Host header"* breaks your server, that is what should be fixed, not IIS. - (Although I suspect that your problem *might* more accurately be that IIS does not set **the correct `Host:` header** and the target server needs a specific Host header to present the correct site ... ) – HBruijn Feb 01 '19 at 08:52
  • Thanks.. The external target server is a commercial service and can't be changed. I'll have to come up with another way to create a forward proxy to it. – Matt Feb 01 '19 at 18:28
  • Is there a way to change the Host: header in IIS when it forwards the request? – Matt Feb 05 '19 at 18:31

0 Answers0