【发布时间】:2021-05-27 01:58:52
【问题描述】:
我想在 Kubernetes 中设置 WordPress PHP-fpm,所以我已经设置了,但是目前我在使用 Nginx 代理时遇到了一些问题,所以当我尝试安装 woo-commerce 插件时,它会给出错误的
安装失败:504 Gateway Time-out 504 Gateway Time-out nginx padding to disable MSIE and Chrome friendly error page ->
我不知道代理出了什么问题我已经将 proxy_read_timeout 的最大值设置为 100。但它也不起作用。我尝试了这么多代理超时值,但都不起作用,所以这是我的 Nginx 代理配置
wordpress.conf
server {
listen 80;
server_name localhost;
root /var/www/html;
index index.php;
#access_log /var/log/nginx/hakase-access.log;
#error_log /var/log/nginx/hakase-error.log;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass wordpress:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_cache phpcache;
fastcgi_cache_valid 200 301 302 60m;
fastcgi_cache_min_uses 1;
fastcgi_cache_lock on;
add_header X-FastCGI-Cache $upstream_cache_status;
fastcgi_cache_use_stale error timeout updating invalid_header http_500 http_503;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=phpcache:100m max_size=10g inactive=60m use_temp_path=off;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
【问题讨论】:
-
这是您的本地环境还是本地环境?这个问题是在你安装
woo-commerce plugin之后出现的,在此之前,它工作正常吗?
标签: php wordpress docker nginx kubernetes