title: Django+Nginx+uWSGI = 504 Gateway Time-out
body: <p>I am running Ubuntu 10.04, Django 1.3, Nginx 0.8.54 and uWSGI 0.9.7.</p>
  
  <p>Both Nginx and uWSGI load without error. However, when you access my site, it sits for a LONG time and then eventually loads a "504 Gateway Time-out" error.</p>
  
  <p>Here is my Nginx Virtual Host conf file:</p>
  
  <pre><code>server {
  listen          80;
  server_name     www.mysite.com mysite.com;
  error_log       /home/mysite/log/error.log;
  access_log      /home/mysite/log/access.log;
  
  location / {
      auth_basic  "Restricted";
      auth_basic_user_file    /home/mysite/public/passwd;
      include uwsgi_params;
      uwsgi_pass unix:///home/mysite/public/myapp.sock;
  }
  
  location /media {
      alias /home/mysite/public/myapp/media;
  }
  
  
  error_page  401  /coming_soon.html;
  
  location /coming_soon.html {
      root /home/mysite/public/error_pages/401;
  }
  
  location /401/images {
      alias /home/mysite/public/error_pages/401/images;
  }
  
  location /401/style {
      alias /home/mysite/public/error_pages/401/style;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>My site log shows this:</p>
  
  <pre><code>SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request / !!!
  </code></pre>
  
  <p>My error log show this:</p>
  
  <pre><code>upstream timed out (110: Connection timed out) while reading response header from upstream
  </code></pre>
  
  <p>I have two other sites on this server with the same configuration and they load PERFECTLY.</p>
  
  <p>Has anyone else encountered this problem? There are several threads on here that are similar to my issue and I've tried several of those solutions but nothing seems to work. </p>
  
  <p>Thank you in advance for your help!</p>