简体   繁体   English

uWSGI无法使用.ini文件

[英]uWSGI NOT working with .ini file

uWSGI NOT working with .ini file but works directly from command line. uWSGI无法使用.ini文件,但可以直接从命令行使用。

For this project, I'm using Python with Django , NGinX and uWSGI . 对于这个项目,我将PythonDjangoNGinXuWSGI When running the server configuration with parameters directly in the command line, it works but does not work when using the .ini file. 直接在命令行中运行带有参数的服务器配置时,它可以工作,但在使用.ini文件时不起作用。

In my NGinX configuration, I have this uwsgi_pass command: 在我的NGinX配置中,我有以下uwsgi_pass命令:

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

.ini file: .ini文件:

[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: 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 ). 我只是为了测试而添加了其中的一些参数,但它们并没有改变任何东西( 它不能与documentaton中的简单.ini文件一起使用 )。

nginx site file: nginx站点文件:

    location / {
    uwsgi_pass  django;
    include     /etc/nginx/uwsgi_params;
}

In my project, uwsgi run in docker container 在我的项目中,uwsgi在docker容器中运行

socket = :8000 not work socket = :8000不起作用

but, change to 但是,改为

http-socket = :8000 it work http-socket = :8000可以正常工作

hope that will be helpful 希望对您有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM