Ssl In Loop

My site is in loop (probably https redirects to http and then back) when "Keep HTTPS connection once a secure page is visited:" option is not selected. When selected everything is fine, but I don't want to have default https on. Now all pages are redirected to https in firefox and chrome. I have to delete all history in those browsers to have http back.

This happend after I installed Let's encrypt SSL certificate. Later I removed it and installed Comodo but situation didn't change. Can you give me some directions what to check. I have cs-cart 4.5.2 SP2

Thank you!

I don't want to have default https on.

Why? It will be soon a standard and maybe a requirement in hosting industry. Also Google ranks sites with https higher then sites without a secure connection.

Sounds like your .htaccess file is forcing SSL. Possibly done by the Let’s Encrypt install and not reversed?

Ok. I found it. It was NGINX setting. When I was changing certificate and enabled this one by mistake:

add_header Strict-Transport-Security max-age=15768000;

This should be disabled.

Thanks for help!