title: Ngnix upstream timed out error
body: <p>I have installed php7 and nginx on amazon ec2 instance and getting following error in yii2.</p>
  
  <pre><code>2016/11/11 07:00:33 [error] 11220#0: *14 upstream timed out (110: Connection timed out) 
  while reading response header from upstream, client: XXX.XX.XXX.111, server: 
  example.com, request: "POST /backend/web/index.php?r=site%2Flogin HTTP/1.1",
  upstream: "fastcgi://127.0.0.1:9000", host: "example.com",
  referrer: "http://example.com/backend/web/index.php?r=site%2Flogin"
  </code></pre>
  
  <p>Below are my nginx config file. (/etc/nginx/conf.d/virtual.conf)</p>
  
  <pre><code>server {
      charset utf-8;
      client_max_body_size 128M;
      listen       80;
      server_name example.com;
  
  
      location / {
          root   /path/to/root;
          index index.php  index.html index.htm;
          # Redirect everything that isn't a real file to index.php
          try_files $uri $uri/ /index.php?$args;
      }
  
      error_page  404              /errors/404.html;
      location = /errors/404.html {
          root   /path/to/root;
      }
  
      error_page   500 502 503 504  /errors/50x.html;
      location = /errors/50x.html {
          root   /path/to/root;
      }
  
      # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
      #
      location ~ \.php$ {
          root           /path/to/root;
          fastcgi_pass   127.0.0.1:9000;
          #fastcgi_pass   /var/run/php-fpm.sock;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
          include        fastcgi_params;
          try_files $uri =404;
      }
      location ~ /\.(ht|svn|git) {
          deny all;
      }
  }
  </code></pre>
  
  <p>I already try to to do following but no luck :(</p>
  
  <pre><code>location / {
          ...
          proxy_read_timeout 300;
          ...
      }
  </code></pre>