Nginx Django FastCGI WSGI错误? (非致命)

我用fastcgi在nginx上运行django.当我运行runfcgi时,我看到这些错误:python manage.py runfcgi daemonize=false host=127.0.0.1 port=8000 WSGIServer: missing FastCGI param SERVER_NAME required by WSGI! WSGI

我用fastcgi在nginx上运行django.
当我运行runfcgi时,我看到这些错误:

python manage.py runfcgi daemonize=false host=127.0.0.1 port=8000
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!

在我的nginx错误日志中,我看到了这个:

2011/01/31 10:33:16 [error] 15921#0: *4 FastCGI sent in stderr: "WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!" while reading upstream,client: ::1,server: localhost,request: "GET / HTTP/1.1",upstream: "fastcgi://127.0.0.1:8000",host: "localhost"
2011/01/31 10:38:35 [error] 15921#0: *6 FastCGI sent in stderr: "WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!" while reading upstream,host: 

“本地主机”

一切正常,但只是我不希望我的错误日志充斥着这些信号.我已经看到了关于apache的解决方案,其中涉及使用.htaccess(我认为它无论如何都不相关),但我找不到任何适用于nginx的东西.

最佳答案
添加到nginx位置:

fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

作者: dawei

【声明】:永州站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息

返回顶部