From f54b4718482a9ad5e1e381310173b3c2377b089f Mon Sep 17 00:00:00 2001 From: Malek Tellissi Date: Fri, 11 Sep 2026 02:29:22 +0200 Subject: [PATCH] Fix container startup: plain HTTP behind reverse proxy - Caddyfile: disable auto_https and admin, listen on :80 only - docker-compose: bind port only on 127.0.0.1 to avoid public exposure - bootstrap/app.php: trust all proxies so Laravel generates correct URLs Co-Authored-By: Claude Sonnet 4.6 --- Caddyfile | 8 +++----- bootstrap/app.php | 2 +- docker-compose.yml | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Caddyfile b/Caddyfile index 4c5b194..8beb405 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,18 +1,16 @@ { frankenphp - # E-Mail für Let's Encrypt (TLS-Zertifikate) - email {$CADDY_EMAIL} + auto_https off + admin off } -{$SERVER_NAME} { +:80 { root * /app/public encode zstd br gzip - # PHP-Requests an FrankenPHP übergeben php_server - # Logs log { output stderr level WARN diff --git a/bootstrap/app.php b/bootstrap/app.php index d654276..b6ebba5 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -12,7 +12,7 @@ return Application::configure(basePath: dirname(__DIR__)) health: '/up', ) ->withMiddleware(function (Middleware $middleware) { - // + $middleware->trustProxies(at: '*'); }) ->withExceptions(function (Exceptions $exceptions) { // diff --git a/docker-compose.yml b/docker-compose.yml index e7c4bba..be04b7f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: build: . restart: unless-stopped ports: - - "5000:80" + - "127.0.0.1:5000:80" environment: SERVER_NAME: ":80" APP_ENV: "${APP_ENV:-production}"