From a711ccdc3f449ac533ecce9133041d70a6674820 Mon Sep 17 00:00:00 2001 From: pieter Date: Sat, 13 Dec 2025 22:51:02 +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 | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/templates/configmap.yaml b/templates/configmap.yaml index 06ba068..90ccf1c 100644 --- a/templates/configmap.yaml +++ b/templates/configmap.yaml @@ -47,7 +47,16 @@ data: rewrite ^(/[^/]+)?(/.*\.php) $2 last; } - # PHP処理(最優先) + # 静的ファイル(画像、CSS、JSなど) + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|webp)$ { + expires max; + log_not_found off; + access_log off; + add_header Cache-Control "public, immutable"; + try_files $uri =404; + } + + # PHP処理 location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; @@ -70,19 +79,10 @@ data: fastcgi_read_timeout 300; } + # その他全て(パーマリンク対応) location / { try_files $uri $uri/ /index.php?$args; } - - # WordPress管理画面 - location ~ ^/(wp-admin|wp-login\.php) { - try_files $uri $uri/ /index.php?$args; - } - - # パーマリンク対応(投稿・固定ページ) - location ~ ^/(.+)$ { - try_files $uri $uri/ /index.php?$args; - } location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires max; @@ -94,12 +94,14 @@ data: location = /favicon.ico { log_not_found off; access_log off; + try_files $uri =404; } location = /robots.txt { allow all; log_not_found off; access_log off; + try_files $uri =404; } location ~ /\. {