1

I have a reverse proxy rule that forwards all requests to a specific subdomain to an internal server and everything works great.

 <rule name="cloud.domain.com" enabled="true" stopProcessing="true">
     <match url="(.*)" />
     <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
         <add input="{HTTP_HOST}" pattern="^(cloud.)domain.com$" />
     </conditions>
     <action type="Rewrite" url="http://127.0.0.1:8000/{R:0}" appendQueryString="true" />
 </rule>

This works for both http and https requests to cloud.domain.com. However, I want all requests to http://cloud.domain.com to forward to https://cloud.domain.com which does the reverse proxy to the internal server. Any ideas?

1 Answer 1

2

The Rewrite and ARR modules take an existing request and re-route it to another server to fulfill that request.

SSL should always be between two endpoints, in this case the browser and the final server, you are trying to introduce SSL halfway through the process. If the rewrite module switches to SSL, how does the browser know about this? (it doesn't) What if the browser OS does not trust the certificate of the final server? This should not work.

What you should do it set up a redirect rule for all non-ssl requests, from http:// to https://, then the browser will repeat the request with SSL and it should go through all the way.

You need to add a condition like this one:

<conditions>
  <add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .