d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > 50 Fg For Answer Help
Add Reply New Topic New Poll
Member
Posts: 11,932
Joined: Jun 19 2011
Gold: 8,590.00
Nov 2 2017 08:48am
How do I configure my IIS server to rewrite traffic to my back end apache web server on HTTPS?

i.e.

Traffic comes in --> gets changed to HTTPS --> gets rewritten and forwarded on to apache server in background.


This is what I have at the moment & works 110%:

Traffic comes in --> gets rewritten and forwarded to apache server in background


Code
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://192.168.0.70:32400/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>




Member
Posts: 374
Joined: Mar 13 2017
Gold: 1,070.70
Nov 2 2017 11:50am
<httpRedirect enabled="true"
exactDestination="true"
destination="https://example.com$V$Q"
httpResponseStatus="Permanent"
/>
Member
Posts: 11,932
Joined: Jun 19 2011
Gold: 8,590.00
Nov 2 2017 12:02pm
Quote (4rchon @ Nov 2 2017 06:50pm)
<httpRedirect enabled="true"
exactDestination="true"
destination="https://example.com$V$Q"
httpResponseStatus="Permanent"
/>


this makes no sense to me
Member
Posts: 5,348
Joined: Sep 15 2017
Gold: Locked
Nov 3 2017 05:57am
google is your best friend:

https://stackoverflow.com/questions/19246462/redirect-domain-iis-to-apache

or try this (ofc you have to edit with ur own settings)

<rewrite>
<rules>
<rule name="RewriteToB">
<match url="^B$|^B/(.*)$" />
<conditions>
<add input="{HTTP_HOST}" pattern="^webA$" />
</conditions>
<action type="Rewrite" url="http://webB/{R:1}" />
</rule>
</rules>
</rewrite>

from there
https://forums.iis.net/t/1179226.aspx
Member
Posts: 11,932
Joined: Jun 19 2011
Gold: 8,590.00
Nov 3 2017 01:34pm
worked it out myself

Code

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect-HTTP-HTTPS-IIS">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{CACHE_URL}" pattern="^(https?)://" /> </conditions>
<action type="Rewrite" url="{C:1}://192.168.0.70:32400/{R:1}" />
</rule> </rules>
</rewrite>
</system.webServer>
</configuration>
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll