templates/configmap.yaml を更新

This commit is contained in:
2025-12-17 00:11:00 +00:00
parent 295983f6de
commit a35df09710

View File

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