简体   繁体   English

如何编写等同于 uwsgi 命令的 uwsgi ini 文件

[英]How to write uwsgi ini file equivalent to a uwsgi command

I am testing an application in uWsgi server using the command,我正在使用命令在 uWsgi 服务器中测试应用程序,

uwsgi --http :9090 --wsgi-file myapp.py --callable app --processes 4 --threads 2 --stats 127.0.0.1:9191

That starts the application on 9090 port.这将在 9090 端口上启动应用程序。 I want to write a .ini file for this.我想为此编写一个.ini文件。 But I am stuck with --http:9090 part.但我坚持--http:9090部分。 How it will be written in the ini file? ini文件中会怎么写呢? So far my uwsgi.ini file looks like this,到目前为止,我的uwsgi.ini文件看起来像这样,

[uwsgi]
wsgi-file = myapp.py
callable = app
processes = 4
threads = 2
stats = 127.0.0.1:9191

Configuration directives and command line options are managed by the same parser: https://uwsgi-docs.readthedocs.org/en/latest/Configuration.html 配置指令和命令行选项由同一解析器管理: https : //uwsgi-docs.readthedocs.org/en/latest/Configuration.html

In the case of the ini format you only need to remove the double dashes before the option. 对于ini格式,您只需要删除选项前的双破折号即可。

uwisgi.ini uwisgi.ini

stats = :1717 --stats-http

Documentation: http://uwsgi-docs.readthedocs.org/en/latest/StatsServer.html 文档: http : //uwsgi-docs.readthedocs.org/en/latest/StatsServer.html

This worked for me:这对我有用:

stats = 0.0.0.0:6000
stats-http = true

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

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