templates/configmap.yaml を更新

This commit is contained in:
2025-11-20 07:57:06 +00:00
parent 959c839375
commit 714bbf15af

View File

@@ -1,60 +1,61 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "{{ .Chart.Name }}.fullname" . }}-nginx-config name: {{ include "wordpress-nginx.fullname" . }}-nginx-config
labels: labels:
{{- include "{{ .Chart.Name }}.labels" . | nindent 4 }} {{- include "wordpress-nginx.labels" . | nindent 4 }}
data: data:
nginx.conf: | default.conf: |
user nginx; upstream php-fpm {
worker_processes 1; server 127.0.0.1:9000;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
} }
http { server {
include /etc/nginx/mime.types; listen 80;
default_type application/octet-stream; server_name _;
root /var/www/html;
index index.php index.html;
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' access_log /var/log/nginx/access.log;
'$status $body_bytes_sent "$http_referer" ' error_log /var/log/nginx/error.log;
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main; client_max_body_size 64M;
sendfile on; location / {
keepalive_timeout 65; try_files $uri $uri/ /index.php?$args;
}
server { location ~ \.php$ {
listen 80; fastcgi_split_path_info ^(.+\.php)(/.+)$;
server_name localhost; fastcgi_pass php-fpm;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_buffering off;
fastcgi_read_timeout 300;
}
root /var/www/html; location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
index index.php index.html index.htm; expires max;
log_not_found off;
access_log off;
}
location / { location = /favicon.ico {
try_files $uri $uri/ /index.php?$query_string; log_not_found off;
} access_log off;
}
location ~ \.php$ { location = /robots.txt {
include fastcgi_params; allow all;
fastcgi_pass 127.0.0.1:9000; log_not_found off;
fastcgi_index index.php; access_log off;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
{{- if .Values.nginx.customConfig.enabled }}
{{ .Values.nginx.customConfig.snippet | indent 12 }}
{{- end }}
location ~ /\. {
deny all;
access_log off;
log_not_found off;
} }
} }