Batch redirect to http instead of https i'm working on a project and all batch callbacks in http not https so instead of redirecting to https://example.com/batch?id=844&amp;op=start redirect to http://example.com/batch?id=844&amp;op=start, and as result query params get lost and redirect me after to https://example.com/batch which gives me a 403 forbidden page:

i have checked htaccess file and also the server i don't have any redirection.
anyone has experienced this, any help ?
EDIT:
I have checked the result of \Drupal\Core\Url::fromRoute('&lt;front&gt;')-&gt;setAbsolute()-&gt;toString() i get the url correct with the right protocol and also i have added:
$settings['reverse_proxy'] = TRUE;
$settings['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);

to my settings.php and again no luck.
Note: all redirections in the site works perfectly with https only this one!
For debugging try to output the result of:
\Drupal\Core\Url::fromRoute('&lt;front&gt;')-&gt;setAbsolute()-&gt;toString()

Is this the wrong protocol, too? Then your browser terminates with a different protocol than the CDN to your web server.
Symfony is able to detect the correct protocol, but you need to configure the CDN (reverse proxy) in settings.php.