0

I have a google cloud ubuntu VM instance where I'm deploy flask+nginx+uwsgi and there is a weird issue going on. When I start uwsgi, if it spawn more than one process, nginx can't read the unix socket. I had to "master = false" to make it work, but I want to start multiple processes and all the fancy stuff. uwsgi is started by upstart through a ini file. Here's the ini:

[uwsgi]
plugins = python
user-home = USERHOME
prj = PROJECT
prj-path = PRJ-PATH

# make sure paths exist
socket = /tmp/%(prj).sock
pidfile = /tmp/%(prj).pid
touch-reload = /tmp/reload
daemonize = /var/tmp/%(prj).uwsgi.log

#master = true <- doesn't work
master = false
#enable-threads = true
#post-buffering = true
vacuum = true
harakiri = 30
gevent = 20
#processes = 4 <- doesn't work
#thunder-lock = true

venv = %(user-home)/.virtualenvs/webapp/
pp = %(user-home)/%(prj-path)
wsgi-file = %(pp)/wsgi.py
callable = app

uid = www-data
gid = www-data

nginx setup is simple:

location / {
    include uwsgi_params;
    uwsgi_pass unix:/tmp/projectsock;
}
Italo Maia
  • 1,956
  • 3
  • 18
  • 31

0 Answers0