вот такие настройки nginx:
cat /etc/nginx/sites-available/ochi:
server {
listen 80;
server_name ochi.<bla bla>.in.ua;
root /var/www/ochi/static;
error_log /var/log/nginx/ochi-error-log.log;
include /etc/nginx/fastcgi_params;
location /media {
root /opt/django-trunk/django/contrib/admin;
}
location / {
fastcgi_pass 127.0.0.1:8001;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
}
}
syncdb проходит без ошибок
запускаю приложение
python manage.py runfcgi method=threaded host=127.0.0.1 port=8001
стартую nginx
в urls.py у меня так простенько:
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
)
обращаюсь на корень - 404 - все в порядке
потом захожу в админку - добавляю flatpage для “/”, опять обращаюсь на корень и получаю “An unhandled exception was thrown by the application.”
вообще для любой flatpage такая ошибка получается. хотя админка по-прежнему работает
дальше смотрю в cat /var/log/nginx/error.log :
2009/02/04 10:06:39 9136#0: *9 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!
Traceback (most recent call last):
File ”/var/lib/python-support/python2.5/flup/server/fcgi_base.py“, line 558, in run
protocolStatus, appStatus = self.server.handler(self)
File ”/var/lib/python-support/python2.5/flup/server/fcgi_base.py“, line 1116, in handler
result = self.application(environ, start_response)
File ”/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py“, line 243, in __call__
response = middleware_method(request, response)
File ”/usr/lib/python2.5/site-packages/django/contrib/flatpages/middleware.py“, line 10, in process_response
return flatpage(request, request.path_info)
File ”/usr/lib/python2.5/site-packages/django/contrib/flatpages/views.py“, line 46, in flatpage
response = HttpResponse(t.render©)
File ”/usr/lib/python2.5/site-packages/django/template/__init__.py“, line 176, in render
return self.nodelist.render(context)
File ”/usr/lib/python2.5/site-packages/django/template/__init__.py“, line 768, in render
bits.append(self.render_node(node, context))
File ”/usr/lib/python2.5/site-packages/django/template/debug.py“, line 71, in render_node
result = node.render(context)
File ”/usr/lib/python2.5/site-packages/django/template/loader_tags.py“, line 97, in render
return compiled_parent.render(context)
File ”/usr/lib/python2.5/site-packages/django/template/__init__.py“, line 176, in render
return self.nodelist.render(context)
File ”/usr/lib/python2.5/site-packages/django/template/__init__.py“, line 768, in render
bits.append(self.render_node(node, context))
File ”/usr/lib/python2.5/site-packages/django/template/debug.py“, line 71, in render_node
result = node.render(context)
File ”/usr/lib/python2.5/site-packages/django/template/loader_tags.py", line 111, in
и вот тут я не пойму в чем ошибка
что не так?
причем сам /var/log/nginx/ochi-error-log.log пустой
Python 2.5.2
Django 1.1 pre-alpha SVN-9808
nginx 0.63