O
O
Outsider V.2019-01-23 16:32:39
Magento
Outsider V., 2019-01-23 16:32:39

Why do static files keep downloading over HTTP after enabling HTTPS?

I set Secure Base URL to https://magento22.local , did setup:upgrade
BaZ8C.png
But links to static files are still displayed from http:// , and the browser blocks files as mixed content:
YaNkx.png
I tried to clear all caches, incl. manually, all files included in production mode - the same.
What's the matter? Why doesn't magenta use HTTPS for addresses?
Enabling "Use Secure URLs on Storefront" didn't change anything.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Outsider V., 2019-01-24
@Audiophile

The whole problem turned out to be an underconfigured local SSL. I didn't add this to the site's conf file:

<VirtualHost *:443>

   ...

SSLEngine on

SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>

As a result, Magenta's isSecure() method returned false (I thought that Magenta only checks what protocol the address is requested for, but it checks the values ​​in $_SERVER - HTTPS and PORT) and the settings from the unsecure section were used.

A
Andrey Gavrilov, 2019-01-24
@thexaver

Put https everywhere

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question