title: 502 Bad Gateway with nginx and php7.0-fpm on docker
body: <p>I have created docker image, which includes the Debian packages <code>nginx-full, php7.0, php7.0-fpm, php-zmq</code> and application code written in PHP. </p>
  
  <p>When I am trying to invoke the application from a browser (basically calling <code>zeroMQ</code>), I receive a 502 bad gateway error. How can I find out whether it is a server or a code problem?</p>
  
  <p>Tried changing the permission to the socket file and
  not able to print the PATH_INFO variable.</p>
  
  <p><strong>Nginx log</strong>:</p>
  
  <pre><code>157#157: *622 recv() failed (104: Connection reset by peer) while reading response header from upstream,
  </code></pre>
  
  <p><strong>PHP-FPM log</strong>:</p>
  
  <pre><code>[02-Apr-2018 16:05:26] WARNING: [pool www] child 197 exited on signal 11 (SIGSEGV) after 79.435089 seconds from start
  [02-Apr-2018 16:05:26] NOTICE: [pool www] child 203 started
  </code></pre>
  
  <p><strong>nginx configuration:</strong></p>
  
  <pre><code>location ~ \.php$ {
                  fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                  fastcgi_index index.php;
                  fastcgi_split_path_info ^(.+\.php)(/.+)$;
                  fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                  fastcgi_param PATH_INFO        $fastcgi_path_info;
                  include /etc/nginx/fastcgi_params;
                  }
  </code></pre>
  
  <p><strong>PHP-FPM configuration</strong> :</p>
  
  <pre><code>user = www-data
  group = www-data
  
  //tried  127.0.0.1:900 but did not work
  listen = /run/php/php7.0-fpm.sock
  </code></pre>
  
  <p>After receiving the error, when I do <code>php-fpm</code> reload, the error goes off. But then will happen again.</p>