Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uWSGI NOT working with .ini file

uWSGI NOT working with .ini file but works directly from command line.

For this project, I'm using Python with Django, NGinX and uWSGI. When running the server configuration with parameters directly in the command line, it works but does not work when using the .ini file.

In my NGinX configuration, I have this uwsgi_pass command:

uwsgi --socket ifbAMPdatabase/ifbAMPdatabase.sock --module ifbAMPdatabase.wsgi  --chmod-socket=666

.ini file:

[uwsgi]
project = ifbAMPdatabase
base = /home/ampdbvenv/ifbAMPdb

home = %(base)/pyVenvIFBAMPDB/
chdir = %(base)/%(project)/
#module = %(base)/%(project).wsgi
module = %(project).wsgi:application
wsgi-file = %(base)/%(project)/wsgi.py

master = true
processes = 4

socket = %(base)/%(project)/%(project).sock
chmod-socket = 666
vacuum = true

; plugins=python

enable-threads = true
uid = www-data
gid = www-data
log-date = true

OBS:

Some of these parameters I have added just for testing, but they didn't change a thing (it wasn't working with a simple .ini file like in the documentaton).

nginx site file:

    location / {
    uwsgi_pass  django;
    include     /etc/nginx/uwsgi_params;
}
like image 756
Auyer Avatar asked Dec 29 '16 20:12

Auyer


People also ask

What is uWSGI INI file?

. INI files are a de facto standard configuration format used by many applications. It consists of [section] s and key=value pairs. An example uWSGI INI configuration: [uwsgi] socket = /tmp/uwsgi.sock socket = 127.0.0.1:8000 workers = 3 master = true.

Is Nginx required for uWSGI?

That's the simple answer, anyway -- you don't need it. uWSGI is itself a capable server.

Which is better Gunicorn or uWSGI?

Both can reach very impressive levels of performance, though some have mentioned that Gunicorn works better under high load. Drawbacks to Gunicorn are much the same as uWSGI, though I personally have found Gunicorn to be more easily configurable than uWSGI.

How do I know if uWSGI is running?

Check the status of the uwsgi process to find out whether it was able to start: sudo systemctl status uwsgi.


1 Answers

In my project, uwsgi run in docker container

socket = :8000 not work

but, change to

http-socket = :8000 it work

hope that will be helpful

like image 88
赖正博 Avatar answered Oct 24 '22 10:10

赖正博