Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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}" />
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.