Reputation: 3140
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:
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?
Upvotes: 1
Views: 8941
Reputation: 7522
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.
Feel free to let me know if there is anything I can help with.
Upvotes: 6