繁体   English   中英

超时 504 网关超时 nginx 在 wordpress-php-fpm

[英]Time-out 504 Gateway Time-out nginx in wordpress-php-fpm

我想在 Kubernetes 中设置 WordPress PHP-fpm,所以我已经设置了,但是目前我在使用 Z62E0B5B350C9E3D2C19AA801D9442BA9-commerce 代理时遇到了一些问题,所以当我尝试安装插件时,它给出了错误

安装失败:504 Gateway Time-out 504 Gateway Time-out nginx padding to disable MSIE and Chrome friendly error page -> < ! - 填充以禁用 MSIE 和 Chrome 友好的错误页面 ->

我不知道代理出了什么问题我已经将 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;
}

为我工作的那个

location ~ \.php$ {
    fastcgi_buffers 8 16k;
    fastcgi_buffer_size 32k;
    fastcgi_connect_timeout 300s;
    fastcgi_send_timeout 60;
    fastcgi_read_timeout 60;
}

您必须在单个 pod 内运行两个容器,您可以调试 WordPress 的入口和 nginx 的日志以检查更多详细信息。

您可以使用此 github 作为参考:https://github.com/harsh4870/Kubernetes-wordpress-php-fpm-nginx

另外,查看博客以了解更多信息: https://medium.com/@harsh.manvar111/kubernetes-wordpress-php-fpm-nginx-73cb4f9aef02

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM