Support » Fixing WordPress » 504 Gateway Time-out 504 Gateway Time-out nginx

  • Hi,

    When I try to install plugins I sometimes get an error saying
    504 Gateway Time-out 504 Gateway Time-out nginx
    The website is on my home NAS

    Can someone please help me with this problem? makes it difficult to install things

    Thanks

    Michael

    • This topic was modified 10 months, 2 weeks ago by Yui. Reason: moved to fixing wordpress
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Yui

    (@fierevere)

    ゆい

    Nginx shows 504 when it does not get any response from PHP backend for long time.

    Try increasing timeouts.

    A. If you are using PHP-FPM (fastcgi_pass)

    location ~ \.php$ {
      fastcgi_pass ... 
      fastcgi_read_timeout 300;
    }

    B. If you are using proxying (proxy_pass)

    
    server {
    ...
        proxy_connect_timeout       300;
        proxy_send_timeout          300;
        proxy_read_timeout          300;
        send_timeout                300;
    ...
    }

    Tune up to your needs. I think 3min (180 s) is reasonable, but setting it as high as 5 min (300 s) wont break the things and surely will reach PHP backend, or at least max_execution_time set for PHP

    Thread Starter michaeljanssens

    (@michaeljanssens)

    Yui,

    Thanks for your reply, maybe a sily question but where do you change this?
    The NAS i own is from Synology

    Michael

    Moderator Yui

    (@fierevere)

    ゆい

    in /etc/nginx.conf
    (or /etc/nginx/nginx.conf some reddit threads say its in /usr/local/etc/nginx)
    or its parts included from main file ( with include /path/to/file directive )

    You have to restart nginx after changing its config.
    (with nginx -s reload or via your OS services controller)

    You can refer to your OS documentation where to find the files and how to restart nginx service.

    • This reply was modified 10 months, 2 weeks ago by Yui.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘504 Gateway Time-out 504 Gateway Time-out nginx’ is closed to new replies.