Http statt https beim Installieren

Guten Tag!

Ich möchte Shopware 6 installieren und laufen dabei in einen „mixed content“ Fehler

Mixed Content: The page at ‚Setup | Shopware 6‘ was loaded over a secure connection, but contains a form that targets an insecure endpoint ‚Setup | Shopware 6‘. This endpoint should be made available over a secure connection.

Shopware 6 läuft in einem Caddy, PHP, MySQL Container hinter einem Caddy Reverse Proxy (den ich brauche, da weitere Caddy, PHP, MySQL Container auf dem virtuellen Server laufen)

Was ich bereits versucht habe

also eine framework.yaml symfony.yaml erstellt in /config/packages/prod

siehe hier

---
framework:
    trusted_proxies: '0.0.0.0/0, 10.0.0.0/8, 172.18.0.2/16'
    trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix']

(/config/packages/prod/framework.yaml und /config/packages/prod/symfony.yaml haben den selben Inhalt)

Danach den Symfony Cache geleert

docker exec -it 71c6d07bacf6 php bin/console cache:clear

Warning: Failed to load plugins. Message: An exception occurred in the driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for lcmp-mysql-1 failed: Name does not resolve

 // Clearing the cache for the prod environment with debug false

Warning: Failed to load plugins. Message: An exception occurred in the driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for lcmp-mysql-1 failed: Name does not resolve

 [OK] Cache for the "prod" environment (debug=false) was successfully cleared.
  • TRUSTED_PROXIES in der .env festgelegt
###> shopware/core ###
APP_ENV=prod
APP_URL=https://sw2.vanill.at
TRUSTED_PROXIES=172.18.0.2
APP_SECRET=<redacted>
INSTANCE_ID=<redacted>
BLUE_GREEN_DEPLOYMENT=0
DATABASE_URL=mysql://root:root@localhost/shopware
# With Shopware 6.4.17.0 the MAILER_DSN variable will be used in this template instead of MAILER_URL
MAILER_URL=null://null
###< shopware/core ###

###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
# doctrine://default?auto_setup=0
###< symfony/messenger ###

###> symfony/mailer ###
# MAILER_DSN=null://null
###< symfony/mailer ###

###> symfony/lock ###
# Choose one of the stores below
# postgresql+advisory://db_user:db_password@localhost/db_name
LOCK_DSN=flock
###< symfony/lock ###

###> shopware/elasticsearch ###
OPENSEARCH_URL=http://localhost:9200
SHOPWARE_ES_ENABLED=0
SHOPWARE_ES_INDEXING_ENABLED=0
SHOPWARE_ES_INDEX_PREFIX=sw
SHOPWARE_ES_THROW_EXCEPTION=1
###< shopware/elasticsearch ###

###> shopware/storefront ###
STOREFRONT_PROXY_URL=http://localhost
SHOPWARE_HTTP_CACHE_ENABLED=0
SHOPWARE_HTTP_DEFAULT_TTL=7200
###< shopware/storefront ###

Die IP des Reverse Proxies habe ich mit

herausgefunden

docker network inspect caddy

[
    {
        "Name": "caddy",
        "Id": "6e20a019f8849c9d7852a556cbb2bd4e2a0aa6b2017af37d4d2b631b06f39ea5",
        "Created": "2024-04-19T22:43:34.366677882+02:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "0e9572b26cc92d1551cbcc2c0211385b613e9cba67d45ac52e00c82a21d0974f": {
                "Name": "lcmpsw2-caddy-lcmp-sw2-1",
                "EndpointID": "45bbffbf2f5258574942cc9634631e3fd34efffee49be3c8880ddacfb4fa968b",
                "MacAddress": "02:42:ac:12:00:04",
                "IPv4Address": "172.18.0.4/16",
                "IPv6Address": ""
            },
            "71c6d07bacf6a5040c8bbb3682244d66676344721cbda2e3177d1f6d388644db": {
                "Name": "lcmpsw2-php-lcmp-sw2-1",
                "EndpointID": "dcf08f35a3e6fd03f66a809cbd3b7667b858414ac8d93e133cd602544e1c36ad",
                "MacAddress": "02:42:ac:12:00:03",
                "IPv4Address": "172.18.0.3/16",
                "IPv6Address": ""
            },
            "a5b1aeae0a4935fb62e915b2ff2744703bed41c400b4d0bec90b666bae7a9c04": {
                "Name": "lcmpxt1-apache-lcmp-xt1-1",
                "EndpointID": "db0273d7f0b20fa64fcaa98067dc775f9a97440b36180e373fe61320bfc293d1",
                "MacAddress": "02:42:ac:12:00:05",
                "IPv4Address": "172.18.0.5/16",
                "IPv6Address": ""
            },
            "b5f8fc1cbccfc5774cc4894b3777fa4681386e31ef6203be373bf3990d9ce5af": {
                "Name": "srv-caddy-1",
                "EndpointID": "eb6788962f50b0cc29c57862fa0a7c3a8b0d84e4d66926b2159819b8b7ea326f",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

Berechtigungen wurden mittels
docker exec -it lcmpsw2-php-lcmp-sw2-1 chown -R www-data:www-data /var/www/html

angepasst.

Ich weiß echt nicht mehr, was ich hier tun soll, um das beheben.
Andere Shopsysteme konnten fehlerfrei installiert werden und laufen ohne Fehler mit dem selben Container Setup.

Hier eine Illustration zur Veranschaulichung

[docker - Shopware 6 mixed content error when using reverse proxy - Stack Overflow](https://Frage auf StackOverflow)

Ich bin für jeden Tipp absolut dankbar!

konntest du es lösen?

Ich stehe mit Traefik gerade vor einen ähnlichen Problem!

Hallo,

ja ich konnte es lösen, ich musste in Shopware die index.php abändern, siehe hier Shopware hinter Reverse Proxy nutzt http statt https - #9 von nets