nginx和php-fpm有时会出错502错误的网关

Amazon AWS Ec2 hosted Debian 8 The error is not always and if I restart nginx it's solve the problem for 1 min. I read dozens of posts about it without succes. I tried all this:

In /etc/php5/fpm/pool.d/www.conf

listen = /var/run/php5-fpm.sock
changed in
listen = 127.0.0.1:9000

In /etc/nginx/sites-available/ujuke.fr

fastcgi_pass unix:/var/run/php5-fpm.sock;
changed in
fastcgi_pass 127.0.0.1:9000;

In /etc/nginx/nginx.conf

location ~ \.php$ {
...
added this:
fastcgi_buffers 256 16k;
fastcgi_buffer_size 32k;
}

In /etc/php5/fpm/pool.d/www.conf uncommented:

;listen.mode = 0660

In /etc/nginx/fastcgi_params added this:

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  PATH_INFO          $fastcgi_script_name;

In /etc/nginx/nginx.conf

changed
user www-data;
to
user www-data www-data;

nothing worked, any idea ?