# Shop auf SSL - mixed content, Bilder URL wird als http anstatt als https geladen.

**URL:** <https://forum.shopware.com/t/shop-auf-ssl-mixed-content-bilder-url-wird-als-http-anstatt-als-https-geladen/54220>\
**Category:** Sonstiges\
**Created:** [23. Juli 2018 um 09:55 UTC](https://forum.shopware.com/t/shop-auf-ssl-mixed-content-bilder-url-wird-als-http-anstatt-als-https-geladen/54220 "2018-07-23T09:55:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergej](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sergej](https://forum.shopware.com/u/sergej)\
**Post date:** [23. Juli 2018 um 09:55 UTC](https://forum.shopware.com/t/shop-auf-ssl-mixed-content-bilder-url-wird-als-http-anstatt-als-https-geladen/54220/1 "2018-07-23T09:55:58Z")

</div>

Guten Tag,

Ich habe den Shop erst ohne SSL installiert und&nbsp;dann auf SSL umgestellt.

Auch in Grundeinstellungen -\>Shopeinstellungen -\> Shops -\> SSL verwenden aktiviert. Auch Bestellvorgang wird fehlerfrei abgeschlossen.

&nbsp;

Das Problem ist dass das „eigenes Logo“ und die „Artikelbilder“ als http anstatt als https geladen werden.

&nbsp;

Die Bilder in Einkaufswelten, werden dagegen richtig als https geladen.

&nbsp;

Beispiel mit Logo

&nbsp;

Fehler:

_Mixed Content: The page at ‘[https://myshop.de/en](https://myshop.de/en)’ was loaded over HTTPS, but requested an insecure image ‘[http://myshop.de/media/image/f4/65/d1/logo.jpg](http://myshop.de/media/image/f4/65/d1/logo.jpg)’. This request has been blocked; the content must be served over HTTPS._

_10Mixed Content: The page at ‘’ was loaded over HTTPS, but requested an insecure image ‘’. This content should also be served over HTTPS._

&nbsp;

In den Seitenquellentext sieht man, dass der Logo-link (

) über (url controller=‘index’) richtig als https ausgegeben wird aber die Bilder selbst als HTTP:

&nbsp;

\_

![myshop.de - Switch to homepage]()

&nbsp;

Wen man das Gleiche aber mit dem DemoShop Logo macht, wird es über https geladen.

&nbsp;

![myshop.de - Switch to homepage]()

&nbsp;

Folgendes hatte ich schon in Bezug auf Logo ausprobiert:

&nbsp;

logo-container.tpl + undex.tpl aus (/themes/Frontend/Bare/frontend/index) in (/themes/Frontend/mytheme/frontend/index) kopiert und folgende Änderungen in „Logo-container.tpl“ ausprobiert.

Original

{block name=‘frontend\_index\_logo’}

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ![{]()

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; {/block}

&nbsp;

Änderungen

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ![{]()

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Auch habe ich die URL in kürzerer Form probiert einzugeben “/media/image/f4/65/d1/logo.jpg“

Leider war der shop nach der Änderung nicht mehr erreichbar, wenn man die Original Dateien logo-container.tpl + undex.tpl in (/themes/Frontend/mytheme/frontend/index) lässt, wir der shop ganz normal geladen. Die geänderte Datei logo-container.tpl habe ich auch in die „Bare“ Theme geladen (/themes/Frontend/Bare/frontend/index) auch danach war der Shop nicht mehr erreichbar.

Das Problem mit den Artikelbildern habe ich noch nicht angefasst, da es wohl zusammenhängt.

Cache wurde nach jedem Schritt im Shop Backend und in zwei Browser geleert.

Hat Jemand eine Idee was ich noch prüfen kann? Danke im Voraus.

&nbsp;\_

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [23. Juli 2018 um 09:57 UTC](https://forum.shopware.com/t/shop-auf-ssl-mixed-content-bilder-url-wird-als-http-anstatt-als-https-geladen/54220/2 "2018-07-23T09:57:58Z")

</div>

[https://forum.shopware.com/discussion/comment/220139/#Comment\_220139](https://forum.shopware.com/discussion/comment/220139/#Comment_220139)

Wird wohl ein Proxy dazwischen sein?

---

<div class="post-metadata">

**Author:** ![sergej](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sergej](https://forum.shopware.com/u/sergej)\
**Post date:** [23. Juli 2018 um 10:12 UTC](https://forum.shopware.com/t/shop-auf-ssl-mixed-content-bilder-url-wird-als-http-anstatt-als-https-geladen/54220/3 "2018-07-23T10:12:10Z")

</div>

Hallo Danke für die schnelle Antwort.

Die Konfiguration ist wie folgt.

&nbsp;

XXX.XXX.XXX.XXX – im Original steht die richtige Server IP

&nbsp;

Nginx – Varnish – Apache

&nbsp;

---- nginx konfiguration

# [myshop.de](http://myshop.de)

server {

&nbsp;&nbsp;&nbsp; listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 443 ssl;

&nbsp;&nbsp;&nbsp; server\_name&nbsp;&nbsp;&nbsp; [myshop.de](http://myshop.de) [www.myshop.de](http://www.myshop.de);

&nbsp;&nbsp;&nbsp; access\_log&nbsp;&nbsp;&nbsp;&nbsp; /var/log/nginx/domains/myshop.de.access\_log;

&nbsp;&nbsp;&nbsp; error\_log&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /var/log/nginx/domains/myshop.de.error\_log;

&nbsp;

&nbsp;&nbsp;&nbsp; ssl\_certificate /etc/letsencrypt/live/myshop.de/fullchain.pem;

&nbsp;&nbsp;&nbsp; ssl\_certificate\_key /etc/letsencrypt/live/myshop.de/privkey.pem;

&nbsp;

&nbsp;&nbsp;&nbsp; location /

&nbsp;&nbsp;&nbsp; {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_buffering on;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_pass [http://XXX.XXX.XXX.XXX:6081](http://XXX.XXX.XXX.XXX:6081);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_set\_header X-Client-IP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $remote\_addr;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_set\_header Host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $host;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_set\_header X-Forwarded-For&nbsp; $proxy\_add\_x\_forwarded\_for;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_hide\_header Upgrade;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include /etc/nginx/nginx-vhost-location.conf;

&nbsp;&nbsp;&nbsp; }

&nbsp;

&nbsp;&nbsp;&nbsp; location @fallback

&nbsp;&nbsp;&nbsp; {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_buffering on;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_pass [http://XXX.XXX.XXX.XXX:6081](http://XXX.XXX.XXX.XXX:6081);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_set\_header X-Client-IP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $remote\_addr;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_set\_header Host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $host;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_set\_header X-Forwarded-For&nbsp; $proxy\_add\_x\_forwarded\_for;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy\_hide\_header Upgrade;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include /etc/nginx/nginx-vhost-location.conf;

&nbsp;&nbsp;&nbsp; }

&nbsp;

&nbsp;&nbsp;&nbsp; location ~\* ^.+.(jpg|jpeg|gif|png|ico|svg|js|css|mp3|ogg|mpe?g|txt|mov|flv|wmv|swf|avi|zip|gz|bz2?|rar|pdf|doc|psd|ttf)$

&nbsp;&nbsp;&nbsp; {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expires 365d;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root /var/www/html/myshop.de;

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error\_page 404 = @fallback;

&nbsp;&nbsp;&nbsp; }

}

&nbsp;

------ varnish.params Auschnitt

&nbsp;

# Main configuration file. You probably want to change it.

VARNISH\_VCL\_CONF=/etc/varnish/default.vcl

&nbsp;

# VARNISH\_LISTEN\_ADDRESS=192.168.1.5

VARNISH\_LISTEN\_PORT=6081

&nbsp;

# Admin interface listen address and port

VARNISH\_ADMIN\_LISTEN\_ADDRESS=127.0.0.1

VARNISH\_ADMIN\_LISTEN\_PORT=6082

&nbsp;

# User and group for the varnishd worker processes

VARNISH\_USER=varnish

VARNISH\_GROUP=varnish

&nbsp;

— Apache httpd.conf

&nbsp;

Listen 8080

&nbsp;

# myshop /var/www/html/myshop.de

# PORT 8443 SSL CONFIG

# \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DocumentRoot /var/www/html/myshop.de

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServerName [myshop.de](http://myshop.de)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServerAlias [www.myshop.de](http://www.myshop.de)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ErrorLog “logs/domains/myshop.de.error\_log”

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CustomLog “logs/domains/myshop.de.access\_log” combined

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Options +Includes +FollowSymLinks –Indexes

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AllowOverride All

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allow from all

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SSLEngine on

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SSLCertificateFile /etc/letsencrypt/live/myshop.de/cert.pem

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SSLCertificateKeyFile /etc/letsencrypt/live/myshop.de/privkey.pem

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SSLCertificateChainFile /etc/letsencrypt/live/myshop.de/chain.pem

&nbsp;&nbsp;&nbsp;

&nbsp;

# PORT 80 REDIRECT CONFIG

# \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

&nbsp;

&nbsp;&nbsp;&nbsp; DocumentRoot “/var/www/html/myshop.de”

&nbsp;&nbsp;&nbsp; ServerName [myshop.de](http://myshop.de)

&nbsp;&nbsp;&nbsp; ServerAlias [www.myshop.de](http://www.myshop.de)

&nbsp;&nbsp;&nbsp; ErrorLog “logs/domains/myshop.de.error\_log”

&nbsp;&nbsp;&nbsp; CustomLog “logs/domains/myshop.de.access\_log” combined

&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allow from all

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AllowOverride All

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Options +FollowSymLinks

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Require all granted

&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; #Redirect permanent / [https://myshop.de/](https://myshop.de/)

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [23. Juli 2018 um 10:18 UTC](https://forum.shopware.com/t/shop-auf-ssl-mixed-content-bilder-url-wird-als-http-anstatt-als-https-geladen/54220/4 "2018-07-23T10:18:23Z")

</div>

In meinem verlinkten Beispiel steht ja alles was du machen kannst/prüfen kannst.

Der Varnish wird SSL terminieren und mit dem Appserver nicht per SSL sprechen. Entsprechend kommt bei SW ein HTTP:// request an und die Bilder werden dann auch per HTTP&nbsp;ausgeliefert. Wenn du dir meinen verlinkten Beitrag durchließt, steht da auch wie man das lösen kann.

---

<div class="post-metadata">

**Author:** ![sergej](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sergej](https://forum.shopware.com/u/sergej)\
**Post date:** [23. Juli 2018 um 10:50 UTC](https://forum.shopware.com/t/shop-auf-ssl-mixed-content-bilder-url-wird-als-http-anstatt-als-https-geladen/54220/5 "2018-07-23T10:50:09Z")

</div>

Danke für den Link.

hinzufügen von&nbsp;

$\_SERVER[‚HTTP\_X\_FORWARDED\_PROTO‘] = ‚https‘;

in config.php hat das Problem gelöst.&nbsp;

---

<div class="post-metadata">

**Author:** ![Perkeo](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@Perkeo](https://forum.shopware.com/u/Perkeo)\
**Post date:** [21. August 2019 um 07:53 UTC](https://forum.shopware.com/t/shop-auf-ssl-mixed-content-bilder-url-wird-als-http-anstatt-als-https-geladen/54220/6 "2019-08-21T07:53:32Z")

</div>

Hallo zusammen,&nbsp;

leider habe ich auch das Problem der fehlenden Bilder nach einer Umstellung auf SSL. Die Bilder werden mit http ausgeliefert.&nbsp;

Ich habe mir nun die Anleitung von Moritz durchgelesen und diese Zeile in der config.php ergänzt:

$\_SERVER[‚HTTP\_X\_FORWARDED\_PROTO‘] = ‚https‘;

leider ohne Erfolg, die Bilder sind immer noch verschwunden.&nbsp;

Gibt es noch eine andere Möglichkeit, das Problem zu lösen?&nbsp;

Eine Neuinstallation von Shopware würde das Problem auch nicht lösen, oder doch?&nbsp;

Vielen Dank und viele Grüße,&nbsp;  
Perkeo

---

<div class="post-metadata">

**Author:** ![a.wolsing](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@a.wolsing](https://forum.shopware.com/u/a.wolsing)\
**Post date:** [8. April 2021 um 17:11 UTC](https://forum.shopware.com/t/shop-auf-ssl-mixed-content-bilder-url-wird-als-http-anstatt-als-https-geladen/54220/7 "2021-04-08T17:11:38Z")

</div>

Die Ergänzung für die config.php lautet richtig:

$\_SERVER[‚HTTP\_X\_FORWARDED\_PROTO‘] = ‚https‘,

als zusätzliche Zeile mit einfachen Anführungszeichen oben und Komma am Ende, wenn es innerhalb des return arrays eingebunden wird.  
So hats bei mir einwandfrei funktioniert.
