3

I am running django on top of nginx with fastcgi. When i do runfcgi, I am seeing these errors:

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!

In my error log for nginx, I am seeing this:

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, client: ::1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:8000", host: 

"localhost"

Everything works fine, but it's just that I do not want my error log to be flooded with these signals. I have seen solutions on apache which involves using .htaccess (which I don't think is really related anyhow), but I couldn't find anything that works on nginx yet.

1 Answer 1

7

Add to nginx location:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.