UPDATE: if I don\'t use socket and use 127.0.0.1:3031
instead, everything works fine.
Nginx version is 1.6.3, and uwsgi is 2.0.11.1
ngnix runs as a seperate process, so before you start your application you need to stop the ngnix.
sudo service ngnix stop
. Otherwise the socket myapp.socket
will not be visible to the ngnix. Even though when you do ls /var/www/myapp/myapp.socket
did show up in the terminal results for ls
command. Because ngnix
was started before you run your app using uwsgi myapp.ini
command, ngnix
's process doesn't know what that socket myapp.socket
is . So the trick to avoid this issue is.
sudo service ngnix stop
uwsgi myapp.ini
sudo service ngnix start