Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phillip Ng 148 posts 250 karma points
    Dec 23, 2014 @ 01:28
    Phillip Ng
    0

    Umbraco 7, Azure, and SSL

    Hello

    I am successfully running an Umbraco site on Azure Websites that has Merchello integrated. At this point, we are ready to launch with an SSL cert and had gone so far as to update the A record in my host to point to the IP address provided. Being an e-comm site, I tried to add in a redirect rule to enforce HTTPS, but kept running in to a "infinite loop" problem. I tried this suggestion from ruslany without success, then referenced this "HTTPS on Azure" page. I switched the IP address to the Virtual IP on the AWS Dashboard screen -- still no luck with HTTPS, even after adding a custom hostname in the Back Office.

    The strange thing is that Articulate can be served under SSL, just not the rest of the site. We've tried the HTTPS Redirect package and rerouting in a controller. We're running out of potential solutions. Any advice would be greatly appreciated! Thanks in advance

  • Phillip Ng 148 posts 250 karma points
    Jan 06, 2015 @ 02:21
    Phillip Ng
    0

    Bump. Any thoughts or advice?

  • Comment author was deleted

    Apr 02, 2015 @ 14:59

    I ran into this issue with AWS.  The issue is (on AWS) that by time the request gets to IIS it's actually port 80 instead of 443.  So it gets stuck in a redirect loop because IIS never actually sees traffic on port 443.

    For the front end, I did this:

    //added this due to how the ssl forwarding is working on AWS
    if (HttpContext.Current.Request.Headers["X-Forwarded-Proto"] == "http")
    {
        HttpContext.Current.Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri.Replace("http:", "https:"));
    }

     

    So AWS is sending a special header to signify what protocol is in use upstream.  Perhaps Azure has a similar thing?

    Along these lines, the backoffice has an issue as well when trying to force SSL via the appSetting: umbracoUseSSL.

    That'll send it into a redirect loop as well when set to true.  I'm still trying to find an elegant way to handle this as the code that handles this is here:

    https://github.com/umbraco/Umbraco-CMS/blob/ded1def8e2e7ea1a4fd0f849cc7a3f1f97cd8242/src/Umbraco.Web/WebApi/Filters/UmbracoUseHttps.cs

    https://github.com/umbraco/Umbraco-CMS/blob/9469b0b844d47328a557cf66e517c3059f646ebd/src/Umbraco.Web/Editors/BackOfficeController.cs#L36

  • Comment author was deleted

    Apr 02, 2015 @ 15:07
  • Comment author was deleted

    Apr 02, 2015 @ 15:21

    For the backoffice I've had to override the `LoginController` by creating a custom login controller in a plugin copied from the umbraco.controllers.js file.  The bad news is that if the controller is updated in the core, I'll have to update my plugin.

    angular.module("umbraco").controller("Umbraco.Dialogs.LoginController", function ($scope, localizationService, userService, $location) {
    
        if ($location.protocol() != 'https') {
            window.location.href = $location.absUrl().replace('http', 'https');
        }
    
        ...
        //the rest of the file
Please Sign in or register to post replies

Write your reply to:

Draft