Redirect Problem on AWS ECS with API Gateway

We are running the 4.0 docker image on ECS Fargate and using API Gateway with a domain and SSL certificate.
All system works fine but some times, mautic change HTTPS to HTTP when you click in some button inside mautic. Sometimes, if you refresh the page, it’s change from HTTPS to HTTP.
On site URL inside configurations, we are using the domain with HTTPS.
Im trying to investigate furthermore inside .htaccess but until now I got nothing.

check this in .htaccess

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]