title: error 28105#0: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream
body: <p>I can't config <code>Nginx</code> with <code>php-fpm</code> correctly. When I get any php script, I get Nginx <code>404 Not found</code> error in browser:</p>
  
  <pre><code>File not found.
  </code></pre>
  
  <p>In my php-fpm logs I get:</p>
  
  <pre><code>172.17.42.1 -  28/Apr/2015:09:15:15 +0000 "GET /index.php" 404
  </code></pre>
  
  <p>for any php script call and in Nginx logs I get:</p>
  
  <pre><code>[error] 28105#0: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.168.66.66:9000", host: "localhost"
  </code></pre>
  
  <p>My Nginx vitualhost config is:</p>
  
  <pre><code>server {
    listen 80;
  
    root /var/www/html;
    index index.html;
  
    server_name localhost;
  
    location / {
      # First attempt to serve request as file, then
      # as directory, then fall back to displaying a 404.
      try_files $uri $uri/ =404;
    }
  
    location ~* \.php$ {
      fastcgi_index   index.php;
      fastcgi_pass    127.168.66.66:9000;
      #fastcgi_pass    unix:/var/run/php5-fpm.sock;
      include         fastcgi_params;
      fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
      fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
    }
  }
  </code></pre>
  
  <p>I had spinning php-fpm Docker image from <a href="https://registry.hub.docker.com/_/php/" rel="noreferrer">official php repository</a>, that run by:</p>
  
  <pre><code>docker run -it -p 127.168.66.66:9000:9000 php:fpm
  </code></pre>
  
  <p>The <code>docker ps</code> command show next info:</p>
  
  <pre><code>CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                          NAMES
  dbf9f7d1c6f9        php:fpm             "php-fpm"           8 seconds ago       Up 7 seconds        127.168.66.66:9000-&gt;9000/tcp   serene_curie 
  </code></pre>
  
  <p>What's wrong with my config?</p>
  
  <p>P.S. Any static files (css, js, images) works on Nginx.</p>