diff --git a/src/default.conf b/src/default.conf index 49eccf9..9c9f0e7 100644 --- a/src/default.conf +++ b/src/default.conf @@ -13,11 +13,6 @@ server { set_real_ip_from 0.0.0.0/0; # Replace with Traefik's IP range if known real_ip_header X-Forwarded-For; - # Redirect HTTP to HTTPS if forwarded by Traefik - if ($http_x_forwarded_proto = 'https') { - return 301 https://$host$request_uri; - } - # Location block to pass PHP scripts to FastCGI (PHP-FPM) server location ~ \.php$ { try_files $uri =404; @@ -34,13 +29,17 @@ server { set $https on; } + if ($http_x_forwarded_proto = 'https') { + set $request_scheme https; # Override REQUEST_SCHEME + } + # Pass custom HTTPS parameters and override REQUEST_SCHEME fastcgi_param HTTPS $https; fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto; fastcgi_param REQUEST_SCHEME $http_x_forwarded_proto; } - client_max_body_size 15M; + client_max_body_size 128M; server_tokens off; # Hide PHP headers