From a35df0971069af26cc90d29228eaa90d59bf06f6 Mon Sep 17 00:00:00 2001 From: pieter Date: Wed, 17 Dec 2025 00:11:00 +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 | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/templates/configmap.yaml b/templates/configmap.yaml index b3f1926..98d861b 100644 --- a/templates/configmap.yaml +++ b/templates/configmap.yaml @@ -52,30 +52,17 @@ data: access_log off; } - # wp-adminディレクトリへのアクセス処理(重要) - location /wp-admin { - # wp-adminへのアクセスは必ず末尾スラッシュにリダイレクト - rewrite ^(/wp-admin)$ $1/ permanent; - - # wp-admin内のファイルを処理 - try_files $uri $uri/ /wp-admin/index.php?$args; + # WordPressのパーマリンク対応 + location / { + try_files $uri $uri/ /index.php?$args; } - # wp-includesディレクトリ(静的ファイル優先) - location /wp-includes { - try_files $uri $uri/ =404; - } - - # wp-contentディレクトリ(静的ファイル優先) - location /wp-content { - try_files $uri $uri/ =404; - } - - # PHPファイルの処理(最も重要) + # PHPファイルの処理 location ~ \.php$ { - # セキュリティ: cgi.fix_pathinfo=0 の代替 + # ファイルが存在しない場合は404 try_files $uri =404; + # FastCGI設定 fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; @@ -107,13 +94,6 @@ data: fastcgi_buffer_size 32k; } - # WordPressのパーマリンク対応(メインロケーション) - location / { - # 存在するファイル/ディレクトリ → そのまま配信 - # 存在しない → index.phpで処理(WordPressルーティング) - try_files $uri $uri/ /index.php?$args; - } - # 静的ファイルのキャッシュ location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|otf)$ { expires 1y; @@ -134,11 +114,6 @@ data: log_not_found off; } - # readme.html等の情報漏洩防止 - location ~* ^/(readme|license)\.(html|txt)$ { - deny all; - } - # XML-RPC DDoS対策(必要に応じてコメント解除) # location = /xmlrpc.php { # deny all;