title: docker nginx 502 bad gateway
body: <p>I was trying to change the port number in both nginx.conf and docker-compose.yml  to 9001 instead 9000. However, when I run docker-compose up, it shows 502 Bad Gateway. Why is that? am I locked to use port 9000 only? </p>
  
  <p><strong>nginx.conf</strong></p>
  
  <pre><code>location /index.php {
        include fastcgi_params;
        fastcgi_connect_timeout 10s;
        fastcgi_read_timeout 10s;
        fastcgi_buffers 256 4k;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass php:9000; &lt;-- Changing this to 9001
    }
  </code></pre>
  
  <p><strong>docker-compose.yml</strong></p>
  
  <pre><code>php:
    build: images/php
    volumes:
      - ./images/php/app:/app
    working_dir: /app/public
    command: php-fpm
    links:
      - db
      - cache
    ports:
      - "9000:9000" &lt;-- Changing this to "9001:9001"
  </code></pre>