本文介绍了nginx + uwsgi:-请求了不可用的修饰符:0-的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ubuntu 12.04,nginx 1.2.0,uwsgi 1.0.3

Ubuntu 12.04, nginx 1.2.0, uwsgi 1.0.3.

我使用以下命令启动uwsgi:

I start uwsgi with the following command:

uwsgi -s 127.0.0.1:9010 -M -t 30 -A 4 -p 4 -d /var/log/uwsgi.log

在每个请求中,nginx都会回复502,而uwsgi会写入日志以记录以下行:

On each request nginx replies with 502 and uwsgi writes to log the following line:

-- unavailable modifier requested: 0 --

推荐答案

原始答案

对于Ubuntu 11.10上的 Python 2 ,使用upstart,将uWSGI的python插件与apt-get install uwsgi-plugin-python一起安装,如果您使用的是ini文件来配置uWSGI应用, ,然后将plugins = python添加到[uwsgi]部分,它应该可以解决此问题.

For Python 2 on Ubuntu 11.10, using upstart, install the python plugin for uWSGI with apt-get install uwsgi-plugin-python and if you're using an ini file to configure your uWSGI app, then add plugins = python to the [uwsgi] section and it should solve this problem.

已针对Python 3和Ubuntu 17.10更新

对于Ubuntu 17.10上的 Python 3 ,使用systemd,将uWSGI的python插件与apt-get install uwsgi-plugin-python3一起安装,如果您使用的是ini文件来配置uWSGI应用, ,然后将plugins = python添加到[uwsgi]部分,它应该可以解决此问题.

For Python 3 on Ubuntu 17.10, using systemd, install the python plugin for uWSGI with apt-get install uwsgi-plugin-python3 and if you're using an ini file to configure your uWSGI app, then add plugins = python to the [uwsgi] section and it should solve this problem.

有关python/uWSGI应用程序入门的更多信息,包括如何使用ini文件进行配置,请查看此便捷的指南

For more information on getting started with python/uWSGI apps, including how to configure them using an ini file then please take a look at this handy guide

这篇关于nginx + uwsgi:-请求了不可用的修饰符:0-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 19:20