From 1a37495ab38c5dc5bd3ceaadc6c84ce762d84101 Mon Sep 17 00:00:00 2001 From: pieter Date: Fri, 28 Nov 2025 10:57:43 +0000 Subject: [PATCH] =?UTF-8?q?templates/configmap.yaml=20=E3=82=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/configmap.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/templates/configmap.yaml b/templates/configmap.yaml index 3c08e88..4e554e4 100644 --- a/templates/configmap.yaml +++ b/templates/configmap.yaml @@ -21,6 +21,10 @@ data: client_max_body_size 64M; + # リアルIPの取得(LoadBalancer/Ingress経由の場合) + real_ip_header X-Forwarded-For; + set_real_ip_from 0.0.0.0/0; + location / { try_files $uri $uri/ /index.php?$args; } @@ -34,6 +38,27 @@ data: fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_buffering off; fastcgi_read_timeout 300; + + # HTTPS対応(重要) + fastcgi_param HTTPS $https if_not_empty; + fastcgi_param REQUEST_SCHEME $scheme; + + # X-Forwarded-*ヘッダーの転送 + fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto; + fastcgi_param HTTP_X_FORWARDED_HOST $http_x_forwarded_host; + fastcgi_param HTTP_X_FORWARDED_PORT $http_x_forwarded_port; + fastcgi_param HTTP_X_FORWARDED_FOR $http_x_forwarded_for; + fastcgi_param HTTP_X_REAL_IP $http_x_real_ip; + + # HTTPSが検出された場合の明示的な設定 + set $https_value ""; + if ($http_x_forwarded_proto = "https") { + set $https_value "on"; + } + if ($scheme = "https") { + set $https_value "on"; + } + fastcgi_param HTTPS $https_value; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {