title: Flask + uwsgi + nginx + debug. 502 error instead of debugger page
body: <p>Run Flask on server with uWsgi.  </p>
  
  <p>uWsgi config</p>
  
  <pre><code>&lt;uwsgi&gt;
      &lt;socket&gt;/tmp/flask.sock&lt;/socket&gt;
      &lt;pythonpath&gt;/home/reweb/flask/&lt;/pythonpath&gt;
      &lt;module&gt;publicist:app&lt;/module&gt;
      &lt;plugins&gt;python27&lt;/plugins&gt;
      &lt;uid&gt;reweb&lt;/uid&gt;
     &lt;touch-reload&gt;/home/reweb/reload&lt;/touch-reload&gt;
  &lt;/uwsgi&gt;
  </code></pre>
  
  <p>nginx config  </p>
  
  <pre><code>upstream flask_serv {
      server unix:/tmp/flask.sock;
  }
  
  server {
      listen 80;
      server_name some-domain.com;
  
      access_log /home/reweb/log/nginx-access.log;
      error_log /home/reweb/log/nginx-error.log;
  
      location / {
          uwsgi_pass flask_serv;
          include uwsgi_params;
      }
  }
  </code></pre>
  
  <p>But instead of debugger page nginx show me 502 error.<br>
  All Flask error traceback i can see in uwsgi error log.  </p>
  
  <p><strong>UPDATE</strong><br>
  Find old question <a href="https://stackoverflow.com/questions/11146210/nginx-uwsgi-flask-disabling-custom-error-pages">nginx + uwsgi + flask - disabling custom error pages</a> there is no answer</p>