In recent times I’ve had to handle the Microsoft stack (.NET) among other things. One of the things I’ve faced recently was redirecting traffic hitting the application running on IIS behind an AWS Elastic Load Balancer (ELB) from HTTP to HTTPS. Fairly easy on the Linux stacks which had nginx in front as a reverse proxy (just add a rewrite rule on your HTTP host to HTTPS), but after tinkering around a bit, finally got the correct rewrite rule working (with the help of IIS7’s .htaccess conversion utility).

The transform code you would want to stick into your Web..config (was for a ASP.NET MVC project):

<rewrite xdt:Transform="Insert">
        <rule name="HTTPS rewrite behind ELB rule" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
            <add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" ignoreCase="false" />
          <action type="Redirect" redirectType="Found" url="https://{SERVER_NAME}{URL}" />

This assumes you have the IIS URL Rewrite module installed on your IIS server.


Static website hosting with continuous deployment/delivery

While I was researching on static web hosting with Jekyll, one of the most suggested ways to get it up and running for free is by relying...… Continue reading