Symfony Router redirects to http in https application

I transfer my application from https://mywebsite.com( 1 ) to https://otherwebsite.com( 2 ) The application is host on different servers.

The code below works ( 1 ), the scheme of the generated URL https. The same code on ( 2 ) generates a URL with a httpscheme

$filterUrl = $this->router->generate('liip_imagine_filter', $params, UrlGeneratorInterface::ABSOLUTE_URL);

Route definition

<route id="liip_imagine_filter" path="/media/cache/resolve/{filter}/{path}" methods="GET">
        <default key="_controller">%liip_imagine.controller.filter_action%</default>
        <requirement key="filter">[A-z0-9_\-]*</requirement>
        <requirement key="path">.+</requirement>
</route>

The classic use of the Symfony router, do you have any idea why ( 1 ) I received httpsand on ( 2 ) I received http?

+4
source share
1 answer

schemes host liip_imagine_filter, UrlGenerator .

, PHP -, , . , - -, Nginx, HTTPS- Nginx HTTP, symfony HTTP-.

, (2) - test.php :

<?php

echo $_SERVER['REQUEST_SCHEME'];

.

Symfony - : https://symfony.com/doc/current/deployment/proxies.html

+2

Source: https://habr.com/ru/post/1691465/


All Articles