This question has been archived.

Nginx 500 / 502 Error using uwsgi socket

February 17, 2016 3.1k views
Nginx Python Frameworks Networking Python Ubuntu

Hello, I followed this digital ocean tutorial on Flask/uWSGI.

I got my site up briefly, but then everything just broke. I can only get 500 Internal Server Error or a 502 Bad Gateway. I've spent hours trying to find a fix, but nothing seems to work. I started over from scratch a few times and still nothing.

The Nginx error log writes this error when I view it to check:

2016/02/17 10:28:02 [crit] 7444#0: *7 connect() to unix:/var/www/ failed (2: No such file or directory) while connecting to upstream, client:, server:, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/var/www/", host: "", referrer: ""

I look in that same directory, the that socket file is in there, it exists, but I can't get nginx or uwsgi to recognize the file. All my various config files look the same as the ones in the tutorial just with my own file/folder names - everything is in the /var/www/ project folder.

1 comment
  • What does the following command print?

    file /var/www/
Be the first one to answer this question.