Goedemorgen Amigos! Recently I found a bug that was really annoying me after I was done installing shopware 5 or 6 (if you’ve seen my previous dockware post this shouldn’t happen) in a docker env, the problem was that: there was mixed content and some functionality was lost (logging into the admin, loading images , etc…) so here is the fix for Shopware 5!

In your Shopware 5 project root find the shopware.php file and open it with your preferred code editor. Now before line 120 add this code and save your file:
$_SERVER['HTTPS']='on';
Now go enjoy life with your working shopware 5 store!
In case you are experiencing the same with Shopware 6 then here are the steps to follow: In the root of your sw6 project navigate to the following dir:

yourProjectName/public

and search for the index.php file and edit it with your preferred code editor.  You can now add this code before line 80 and as always remember to save your file, or just enable autosave for havens sake!
Request::setTrustedProxies(
['127.0.0.1', 'REMOTE_ADDR'],
Request::HEADER_X_FORWARDED_ALL
)
*Fantastic! you suddenly feel like a hacker*

Leave a Reply