IIS V10 - URL rewrite conditional to destination

ESP IT Guy 26 Reputation points


I have an op-prem web app that is reverse proxied behind IIS on a web server, I've run into an issue when enabling SAML authentication with 365.

Initiating auth works and the login page opens, username, password and MFA are entered with no issue. I then get an error saying "Application with identifier '' was not found. I'm not sure why the request is going out with the internal IP address of the Application server (not the web server) but I'm looking for a solution to this. I've analyised plenty of traffic both internally and externally and I don't see this ip address being exposed at any other time.

My question: is it possible to create a URL rewrite rule that turns any into https://application.domain?

There could be more to it than this and the traffic isn't going via the web server and the application itself could be configured/misconfigured to give this result. Those are questions I'm still trying to answer.

Any comments appreciated.

Internet Information Services
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dillon Silzer 54,286 Reputation points

    Hi @ESP IT Guy

    You could try a rewrite rule for an IP to a Domain:


    Example from the above Server Fault Question

    web.config (when HTTP_HOST is an IP). You need URL Rewrite module to be installed (v1 is already bundled with IIS 7.5, but you may want to upgrade to v2). Works fine locally on Windows 7:

    <?xml version="1.0" encoding="UTF-8"?>  
                    <rule name="IP Hit" stopProcessing="true">  
                        <match url="(.*)" />  
                            <add input="{HTTP_HOST}" pattern="" />  
                        <action type="Redirect" url="http://www.example.com/{R:1}" redirectType="Permanent" />  


    If this is helpful please accept answer.

    0 comments No comments