Note that there are some explanatory texts on larger screens.

plurals
  1. POConfiguring Nginx server to python flask application
    text
    copied!<p>i am new to configuring server. And i want to configure my Amazon-EC2 instance. I configured it according to this document. <a href="http://www.soundrenalin.com/about" rel="nofollow">http://www.soundrenalin.com/about</a></p> <p>However when i click the url, <code>502 Bad Gateway</code> error is being encountered. My project is located at this path: <code>/home/ubuntu/dsn/app</code>. <br/>And the <code>/home/ubuntu/dsn</code> folder tree is:</p> <pre><code>app/ app.py static/ templates/ themes/ bin/ build/ include/ lib/ local/ run.py </code></pre> <p><br/>Here is my nginx config (<code>/etc/nginx/sites-available/default</code>):</p> <pre><code>server { listen 80; root /home/ubuntu/dsn/app index index.html index.htm; server_name localhost; location / { try_files $uri @app; } location @app { include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi.sock; } } </code></pre> <p>And here is my <code>uwsgi.ini</code> file:</p> <pre><code>[uwsgi] chdir = /home/ubuntu/dsn/ uid = www-data gid = www-data chmod-socket = 666 socket = /tmp/uwsgi.sock module = run virtualenv = /home/ubuntu/dsn/ </code></pre> <p>And the other thing is:<br/> When i run the command <code>tail -f /var/log/nginx/error.log</code> result is:</p> <pre><code>2013/06/09 15:58:11 [error] 5321#0: *1 connect() to unix:/tmp/uwsgi.sock failed (111: Connection refused) while connecting to upstream, client: &lt;myip&gt;, server: localhost, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi.sock:", host: "54.218.14.213" </code></pre> <p>How can i solve this? Thanks. </p>
 

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