templates/configmap.yaml を更新
This commit is contained in:
@@ -49,24 +49,31 @@ data:
|
|||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# templates/configmap.yaml の nginx.conf セクション
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php?$args;
|
try_files $uri $uri/ /index.php?$args;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
# WordPress管理画面用の設定
|
||||||
include fastcgi_params;
|
location ~ ^/(wp-admin|wp-login\.php) {
|
||||||
fastcgi_intercept_errors on;
|
try_files $uri $uri/ /index.php?$args;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
expires max;
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
|
access_log off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user