Note that there are some explanatory texts on larger screens.

plurals
  1. PO502 Bad Gateway error Nginx and uWSGI in deploying Flask app
    primarykey
    data
    text
    <p>I'm trying to deploy a Flask app on a Linode VPS running Ubuntu 10.10. I've been following this tutorial (<a href="https://library.linode.com/web-servers/nginx/python-uwsgi/ubuntu-10.10-maverick#sph_configure-nginx" rel="nofollow">https://library.linode.com/web-servers/nginx/python-uwsgi/ubuntu-10.10-maverick#sph_configure-nginx</a>) but I keep getting a 502 Bad Gateway error.</p> <p>Here this is /etc/default/uwsgi:</p> <pre><code>PYTHONPATH=/var/www/reframeit-im MODULE=wsgi </code></pre> <p>Here is /var/www/reframeit-im/wsgi.py:</p> <pre><code># add the application directory to the python path import sys sys.path.append("/var/www/reframeit-im") # run flask app from reframeit import app as application </code></pre> <p>Here is the app's nginx config file, which is symlinked to the /sites-enabled directory (/opt/nginx/conf/sites-enabled/reframeit-im):</p> <pre><code>server { listen 80; server_name www.reframeit-im.coshx.com reframeit-im.coshx.com; access_log /var/www/reframeit-im/logs/access.log; error_log /var/www/reframeit-im/logs/error.log; location / { include uwsgi_params; uwsgi_pass 127.0.0.1:9001; } } </code></pre> <p>I checked the nginx error logs for the app and I found this:</p> <pre><code>2013/07/17 19:30:19 [error] 20037#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 70.88.168.82, server: www.reframeit-im.coshx.com, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://127.0.0.1:9001", host: "reframeit-im.coshx.com" </code></pre> <p>Is there something wrong with my configuration?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload