After enable https, magento store works as expected but magento admin dashboard gives this error.
3 Answers
Problem Solved !
I have tried many solutions, but none of them work. Finally, I figured out a successful solution.
Step one,
Check your proxy server configuration, In my scenario I used nginx as proxy server.
server {
server_name demoo.magento.xyz; ##replace your domain
location / {
proxy_pass http://127.0.0.1:8000; ##replce your local address and port
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
}
listen 443 ssl http2;
##Do not add these lines, below lines will add after Obtaining an SSL Certificate##
ssl_certificate /xxx.pem;
ssl_certificate_key /xxx.pem;
include /path_to/options-ssl-nginx.conf;
ssl_dhparam /path_to/ssl-dhparams.pem;
}
Step two,
Check your config in db table called core_config_data. usel below command in sql cli.
select * from core_congif_data; and data should be like this,
- web/seo/use_rewrites -> 1
- web/unsecure/base_url -> http://demoo.magento.xyz/ ##replace your address
- web/unsecure/base_link_url -> http://demoo.magento.xyz/
- web/secure/base_url -> https://demoo.magento.xyz/
- web/secure/base_link_url - https://demoo.magento.xyz/
- web/secure/use_in_frontend -> 1
- web/secure/use_in_adminhtml -> 1
- web/cookie/cookie_domain -> null
- web/cookie/cookie_httponly -> null
- web/cookie/cookie_path -> null
- web/secure/base_static_url -> null
- web/secure/base_media_url -> null
- web/secure/enable_hsts -> 0
- web/secure/enable_upgrade_insecure -> 0
Final step,
Clean cache php bin/magento cache:clean
Setup upgrade bin/magento setup:upgrade
deploy static files bin/magento setup:static-content:deploy
Clear browser cache
Congratulations! Now your admin should work properly.
-
please consider marking your answer as solution to your question so others can see it too. cheers!– DianaCommented Feb 24, 2021 at 9:41
-
-
-
@DianaBotean yes, I can suggest this is an "accepted solution" ,but i don't have any privilege to mark it. thank you. Commented Feb 24, 2021 at 11:50
-
Thank you @Harsha Liyadipita. this answer worked for me!
If the database modifications don't fix the problem, the web server may be to blame. I fixed this problem by adding "fastcgi_param HTTPS on;" to my nginx fastcgi_params configuration.