I have just switched our sites over to use SSL and they are working however I am seeing this in the console...

Mixed Content: The page at 'https://www.mysite.co.uk/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.mysite.co.uk/customer/section/load/?sections=cart&update_section_id=false&_=1506870648904'. This request has been blocked; the content must be served over HTTPS.

/pub/static/frontend/name/theme/en_GB/Magento_Customer/js/customer-data.js:86 Uncaught Error: [object Object]
at Object.<anonymous> (/pub/static/frontend/name/theme/en_GB/Magento_Customer/js/customer-data.js:86)
at fire (/pub/static/frontend/name/theme/en_GB/jquery.js:3099)
at Object.fireWith [as rejectWith] (/pub/static/frontend/name/theme/en_GB/jquery.js:3211)
at done (/pub/static/frontend/name/theme/en_GB/jquery.js:9312)
at XMLHttpRequest.callback (/pub/static/frontend/name/theme/en_GB/jquery.js:9720)

I also have a separate store view which is also using SSL and they are setup pretty much identical, yet that site does not have this error.

All of my urls in admin>configuration>web are https

Can anyone point me in the right direction please?

Magento 2.1.4

  • Have you check your core_config_data table and check any value at value coloumn exits with http://www.mysite.co.uk/? – Amit Bera Oct 1 '17 at 15:43
  • Lifesaver thank you - there was still a http entry for web/secure/base_link_url in core_config_data - thanks for your help – Richard Laws Oct 1 '17 at 15:54

You should check this

This 4 fields values at core_config_data database table.

  • Base URL: web/unsecure/base_url
  • Base Link URL: web/unsecure/base_link_url
  • Secure Base URL: web/secure/base_url
  • Secure Base Link URL: web/secure/base_link_url

Check this 4 field value should start with https

enter image description here

|improve this answer|||||
  • Thanks - in admin they looked correct but in the database it didnt - weird - solved thanks – Richard Laws Oct 2 '17 at 11:54

try to paste this in your index.php

    $_SERVER['HTTPS'] = 'on';
    $_SERVER['SERVER_PORT'] = 443;


$_SERVER['HTTPS'] = 'on';

got it here.

Happy Coding

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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