user1964234
user1964234

Reputation: 129

AWS Beanstalk IIS Instance and forcing SSL

Just can't seem to get this one ...

I have an AWS Beanstalk app running on IIS. The load balancer is configured for SSL and so is the security group.

So, I enter http://www.example.org and it works.

I enter https://www.example.org and it works too. Running SSL, great!

Now, I want to force SSL, so my understanding from this thread (Redirect to https through url rewrite in IIS within elastic beanstalk's load balancer) is that I configure the health check and add the described rule in the web.config file.

When I enter http://www.example.org I should redirect to HTTPS, but it doesn't work for me?

I seem to have two web.config files, one under the Default IIS site and one under my own site (beneath the Default). This entry doesn't seem to work in either place, but bonks completely under the default site.

Any ideas about what I am doing wrong?

Upvotes: 1

Views: 628

Answers (1)

user1964234
user1964234

Reputation: 129

Okay, my last paragraph tipped me off.

I was exporting my application (locally) as a sub application of the IIS Default app. This same configuration translates to AWS - so AWS adds a rewrite rule in the Default app to point to the sub application you deployed.

I had two web.config files. One in the Default IIS app and the other in my application.

So, I changed my local config so my app WAS the Default and then exported and deployed the same configuration to AWS.

As the Default app in IIS the redirect works!

Upvotes: 1

Related Questions