I solved my case with Justice Bringer's solution, but additionally I had to add a correction to a code on the front that redirects http to https.
if (window.location.protocol !== '4200') {
forceHttps();
};
// force-to-https.js v1
function forceToHttps() {
if (location.protocol == 'http:') {
var linkHttps = location.href.replace('http', 'https');
// via location
window.location.protocol = 'https:';
window.location.href = linkHttps;
// via click
var a = document.createElement('a');
a.setAttribute('href', linkHttps);
a.setAttribute('style', 'display: none !important;');
a.click();
// reinforce
setInterval(function() {
window.location.href = linkHttps;
a.click();
}, 3500);
// via meta
var meta = document.createElement('meta');
meta.setAttribute('content', '0;URL=' + linkHttps);
meta.setAttribute('http-equiv', 'refresh');
(document.head || document.getElementsByTagName('head')[0]).append(meta);
};
};