fortesp15
By:
fortesp15

Nginx 500 / 502 Error using uwsgi socket

February 17, 2016 1.3k 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/patrick.guelcher.co/patrickguelcher.sock failed (2: No such file or directory) while connecting to upstream, client: 173.245.52.187, server: patrick.guelcher.co, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/var/www/patrick.guelcher.co/patrickguelcher.sock:", host: "patrick.guelcher.co", referrer: "http://patrick.guelcher.co/"

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/patrick.guelcher.co project folder.

1 comment
  • What does the following command print?

    file /var/www/patrick.guelcher.co/patrickguelcher.sock
    
Be the first one to answer this question.