I've followed all the solutions found in similar issues in the forum. I have no succeed doing it.

What i have:

  • Magento 2.4.3
  • Varnish Cache 6 (set to work at port 80)
  • Apache (set to work at port 8081 for http traffic)
  • Nginx (set as SSL reverse proxy at port 443) In Ubuntu 22.04 server.

What is my current state: Both http and https pages are loading fine.

What i want to achieve: I want all http pages to redirect permanently to https. Until now Google had indexed all my http pages.

What i've tried: Edit the .htaccess files with lines that by theory should redirect traffic (no success) Edit Nginx conf file and Apache conf file - separately and together - again no result

I want to be able to access my Admin panel in http - but is essential frontend to redirect to https.

What can i do any suggestions ?

  • Update your Base URLs and add https i.e. both base and secure base url should point to https
    – Pawan
    Commented Apr 4 at 4:09
  • just updating the base url - works fine - i also change URL rewrite to 301. Thank you
    – rt89
    Commented Apr 4 at 16:51

1 Answer 1


As @Pawan suggested, Base URL and Secure Base URL both should have the values with https.

Apart from this, please check whether Use Secure URLs on Storefront is set to Yes.

Change the value of Enable HTTP Strict Transport Security (HSTS) to Yes.

Read more about HSTS here.

Change the value of Upgrade Insecure Requests to Yes.

Read more about Upgrade Insecure Requests here.

I hope it should work now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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