Liipimaginebundle: Url is still http in https

Created on 15 Apr 2016  路  20Comments  路  Source: liip/LiipImagineBundle

Hi,

This is my problem : My website is in https but the urls generated by imagine_filter are in http.

I don't know how to solve that.

Maybe is there any parameter to configure to make it work ?

Most helpful comment

I have been searching for ages and didn't think of this ...
anyway setting :
TRUSTED_PROXIES=127.0.0.1, 172.20.0.0/8
in my .env.local fixed the issues
thanks a million

All 20 comments

What value do you have for framework.assets.base_urls ?

Hi mitrae,

I didn't configure this.

I tried to set 'https://my.domain.com' but the problem is the same unfortunately.

what symfony version are you using?

starting from 2.7:
http://symfony.com/blog/new-in-symfony-2-7-the-new-asset-component

I'm using 2.8.3.

So I tried to add :

framework:
assets:
base_urls: ['https://my.domain.com']

And nothing happened.

Seems imagine_filter ignores this parameter. This filter by itself generates absolute url

@pDc- what resolve do you use? s3, local or?

Hi makasim,

I'm using the default resolver so does it call the WebPathResolver in the Bundle ?

I tried to define router.request_context.scheme as https in parameters.yml but nothing changed.

The router is used internally.

Yes, I took a look at this. That's why I tried to define router.request_context.scheme.

What am I doing wrong ? Should I declare another Resolver in the config ?

Here is my basic configuration of the Bundle :

liip_imagine:
    resolvers:
       default:
          web_path: ~
    filter_sets:
        cache: ~
        thumbpic:
            quality: 75
            filters:
                thumbnail: { size: [40, 40], mode: outbound }

when http request is coming symfony rewrites it with actual request options. That's why this parameters do not work

Parameters are only make sense for cli commands.

I suspect that the request coming is http itself. Check this first.

Ok thanks for your answers !
I'm going to check this then. Maybe that's because I'm behind a HA Proxy.
I'll ask to the administrator.

I'll keep you in touch soon.

Hi !

Thank you so much for your help. It was a problem with the server as you suspected @makasim .
The proxy was correctly configured but the server wasn't.

I'm sorry for disturbance..

I can close the issue.

Thanks again for your help @makasim and @mitrae !

np

What to do about this if you're behind a reverse proxy handling the HTTPS stuff and dispatching the requests as HTTP to various Docker containers running the actual Symfony application?

Is there a way to force the generated asset urls to be HTTPS?

I am running my symfony 4.3 app in a docker container with Traefik reverse proxy and all images using the liip imagine filter are served over http instead of https.

I haven't found a way to get this to work correctly, any help would be greatly appreciated

Thanks for the fast reply I'm going to look into that right now

I have been searching for ages and didn't think of this ...
anyway setting :
TRUSTED_PROXIES=127.0.0.1, 172.20.0.0/8
in my .env.local fixed the issues
thanks a million

Was this page helpful?
0 / 5 - 0 ratings