2

I have installed Nginx and php7.1-fpm on Ubuntu 16.04. It was working perfectly fine. I am started getting 504 Gateway Time-out error.

When I checked the Nginx log, I got this errors:

 *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: server.name,, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.1-fpm.sock", host: "example.com", referrer: "http://example.com/"

Here is my virtual host file

server {

    listen 80 default_server;
        listen [::]:80 default_server;

    server_name example.com;

    root /var/www/example/public;

        index index.html index.htm index.nginx-debian.html index.php;

        location / {

                 try_files $uri $uri/ /index.php?$query_string;

        }

    location ~ \.php$ {
            try_files $uri /index.php =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
                include fastcgi_params;
        }


    location ~ /\.ht {
                deny all;
        }
}

Please guide why I am getting this error. How can I resolve it.

O. Neel
  • 21
  • 3
  • Did you find out what your issue was? – Mark Ellul Jul 09 '18 at 07:25
  • Maybe you have an error in your php code. We resolve similar issue fixing our code like next answer: https://stackoverflow.com/questions/26070299/nginx-php-fpm-504-timeout-error-upstream-timed-out-110-connection-timed-o – Abdualiym Jul 05 '20 at 12:32

0 Answers0