title: AJAX using HTTP instead of HTTPS
body: <p>My AJAX request is using HTTP even though the request is originating from a page using HTTPS.  Any idea why it's downgrading to HTTP?</p>
  
  <p>Here's my AJAX request:</p>
  
  <pre><code>$(function() {
  
    // Update section options whne course is changed
    $('#id_new_course').change(function() {
  
      // Get selected coursenum
      var val = $(this).val();
      var sect_input = $('#id_section');
  
      // Disable #id_section when no course is selected
      if (val == '') {
        sect_input.empty();
        sect_input.prop('disabled', true);
      } else {
        // Get list of sections for selected course and update #id_section options
        $.ajax({
          url: '/account/support_dashboard.get_course_sections/' + val + '/',
          dataType: 'json',
          success: function(data) {
            // Empty options and add new ones to #id_section
            sect_input.empty();
            $.each(data, function(value, key) {
              sect_input.append($('&lt;option&gt;&lt;/option&gt;').attr('value', value).text(key));
            });
            sect_input.prop('disabled', false);
          },
          error: function() {
            console.log('ERROR OCCURRED TRY AGAIN');
          }
        });//ajax
      }//if
  
    });
  
  }); //ready
  </code></pre>
  
  <p>Here's the error output in my web console:</p>
  
  <pre><code>Mixed Content: The page at 'https://www.myeducator.com/account/support_dashboard/1027/993532704604577793/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.myeducator.com/account/support_dashboard.get_course_sections/915ba/'. This request has been blocked; the content must be served over HTTPS.
  </code></pre>
  
  <p>The javascript file is being loaded over HTTPS:</p>
  
  <p><img src="https://i.stack.imgur.com/csdlp.png" alt="Request Over HTTPS"></p>
  
  <p>Also, the actual ajax request is going out as HTTPS:</p>
  
  <p><img src="https://i.stack.imgur.com/FV2Rb.png" alt="AJAX Request over HTTPS"></p>
  
  <p>I also don't think it has anything to do with my web server (nginx).  I only have a single rewrite command that redirects any unhandled subdomains to www.myeducator.com using the same request scheme:</p>
  
  <pre><code>server {
    listen 443 default_server ssl;
    server_name _;
  
    ...
  
    # the rewrite string
    rewrite ^ $scheme://www.myeducator.com$request_uri redirect;
  }
  </code></pre>