PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, June 24, 2022

[FIXED] How to Enable SSL offloading on IIS Reverse Proxy

 June 24, 2022     arr, iis, reverse-proxy, windows     No comments   

Issue

I have just enabled Reverse Proxy for my NodeJS application on Windows Server by enabling Application Request Routing (ARR) and editing the web.config file by following this article:

https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing

Now, everything is working fine, I am able to access my NodeJS application running on localhost from an external client outside the server. I want to enforce Https connection to this reverse proxy I've just created. How do I achieve this?


Solution

IIS URL Rewrite extension could accomplish this task. Please Install the extension.
https://www.iis.net/downloads/microsoft/url-rewrite
In order to force HTTP connection to https connection, please add the below Url rules in the webconfig file which can be recognized by IIS.

<system.webServer>
           <rewrite>
            <rules>
              <rule name="Force SSL (https)" enabled="true" stopProcessing="false">
                <match url="(.*)" ignoreCase="false" />
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                  <add input="{HTTPS}" pattern="off" />
                </conditions>
                <action type="Redirect" url="https://example.com/{REQUEST_URI}" redirectType="Permanent" />
              </rule>
            </rules>
          </rewrite>
    </system.webServer>

Alternatively, we could manually set up the rule by using the URL Rewrite extension after installation.
enter image description here
enter image description here
enter image description here
Feel free to let me know if there is anything I can help with.



Answered By - Abraham Qian
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,259,226

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing