title: Get 502 Bad Gateway when use fastcgi_pass: 127.0.0.1:9000
body: <p>I have next <code>docker-compose</code> file:</p>
  
  <pre><code>nginx:
      build: .
      ports:
          - "80:80"
          - "443:443"
      links:
          - fpm
  fpm:
      image: php:fpm
      ports:
          - "9000:9000"
  </code></pre>
  
  <p>The <code>Dockerfile</code> command list is:</p>
  
  <pre><code>FROM nginx
  
  ADD ./index.php /usr/share/nginx/html/
  
  # Change Nginx config here...
  RUN rm /etc/nginx/conf.d/default.conf
  ADD ./default.conf /etc/nginx/conf.d/
  </code></pre>
  
  <p>And my custom Nginx config <code>default.conf</code> file is:</p>
  
  <pre><code>server {
      listen  80;
  
      server_name localhost;
      root /usr/share/nginx/html;
  
      error_log /var/log/nginx/localhost.error.log;
      access_log /var/log/nginx/localhost.access.log;
  
      location / {
          # First attempt to serve request as file, then
          # as directory, then fall back to displaying a 404.
          try_files $uri $uri/ =404;
          # Uncomment to enable naxsi on this location
          # include /etc/nginx/naxsi.rules
      }
  
      location ~ \.php$ {
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
         # With php5-cgi alone:
         fastcgi_pass 127.0.0.1:9000;
         # With php5-fpm:
         #fastcgi_pass unix:/var/run/php5-fpm.sock;
         fastcgi_index index.php;
         include fastcgi_params;
      }
  }
  </code></pre>
  
  <p>After <code>docker-compose up</code> command the static pages work fine when I get <code>http://localhost/index.html</code>.
  But when I open <code>http://localhost/index.php</code> I had an error <code>502 Bad Gateway</code>.</p>
  
  <p>I think the problem with incorrect <code>fastcgi_pass</code>. Could anybody help me config <code>fastcgi_pass</code> in my case, please?</p>