Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed content : https is missing for images #214

Closed
Damiano1376 opened this issue Oct 10, 2018 · 6 comments
Closed

Mixed content : https is missing for images #214

Damiano1376 opened this issue Oct 10, 2018 · 6 comments

Comments

@Damiano1376
Copy link

Damiano1376 commented Oct 10, 2018

Hello,

I have a problem with https :
Mixed Content: The page at 'https://www.mydomain.com/fr/' was loaded over HTTPS, but requested an insecure image 'http://www.mydomain.com/media/cache/listing_large/uploads/listings/images/default-listing.png'. This content should also be served over HTTPS.

I have already set https in parameters.yml, what should I do to fix this?

Q A
Bug report? [ ]
Feature request? [ ]
Support request? [yes]
@doydoy44
Copy link

I had the same problem and and in my case I solved it with the Reverse Proxy:
https://symfony.com/doc/2.8/deployment/proxies.html#but-what-if-the-ip-of-my-reverse-proxy-changes-constantly

@cocolabssas
Copy link
Contributor

Hi Damiano1376,

If you set cocorico.assets_base_urls parameter with 'https://www.mydomain.com/fr/' value and router.request_context.scheme to https it should work.
As @doydoy44 say your problem seems more a server misconfiguration than an application one.
This post seems to confirm that also : liip/LiipImagineBundle#727

@Damiano1376
Copy link
Author

I think you're right, there is a problem with my nginx-proxy. I use docker for cocorico and nginx , does anyone knows how to manage correctly https configuration in this two containers?

@Damiano1376
Copy link
Author

Hello cocorico team,
I think i am on the way, but i still need help.

I think my error come from LiipImagineBundle because everything is in https excepted images in cache.
I thound this post :
liip/LiipImagineBundle#1050

Considering the second solution, il should add a line in security.yml

security: access_control: - { path: ^/your/custom/cache/path, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https } - { path: ^/media/cache/resolve, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
What are the right paths for cocorico?

@cocolabssas
Copy link
Contributor

cocolabssas commented Oct 13, 2018

Hello @Damiano1376 ,

Great news :)
It should be ^/media/cache/
You can look the web/media folder and the urls of the images you have in your browser to be sure.

@nmuntyanov
Copy link

@Damiano1376
This is a solution liip/LiipImagineBundle#1059
But I don't know when guys will accept it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants