From 0cb5560ad0df69544e00a5b3b1743eedaf923d24 Mon Sep 17 00:00:00 2001 From: pieter Date: Mon, 15 Dec 2025 02:11:34 +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 | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/templates/configmap.yaml b/templates/configmap.yaml index 47ca10b..15e198d 100644 --- a/templates/configmap.yaml +++ b/templates/configmap.yaml @@ -49,24 +49,31 @@ data: access_log off; } + # templates/configmap.yaml の nginx.conf セクション location / { try_files $uri $uri/ /index.php?$args; } - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_pass php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param HTTPS $fastcgi_https; - fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto; - fastcgi_param HTTP_X_FORWARDED_FOR $http_x_forwarded_for; - fastcgi_param HTTP_X_REAL_IP $real_ip; - fastcgi_param REMOTE_ADDR $real_ip; + # WordPress管理画面用の設定 + location ~ ^/(wp-admin|wp-login\.php) { + try_files $uri $uri/ /index.php?$args; } - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + # PHPファイルの処理 + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass 127.0.0.1:9000; # または wordpress コンテナのサービス名 + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } + + # 静的ファイルのキャッシュ設定(オプション) + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires max; log_not_found off; + access_log off; } } \ No newline at end of file