Форум сайта python.su
поставил python-flup nginx рабочий
сделал скрипт в дирректории
#!/usr/bin/env python
def myapp(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['Hello World!\n']
if __name__ == '__main__':
from flup.server.fcgi import WSGIServer
WSGIServer(myapp).run()
server {
listen 80;
server_name pytest;
access_log /home/www/python/adserver-access.log combined;
charset utf-8;
location / {
root /home/www/python;
fastcgi_pass unix:/home/www/python/fcgi_wsgi.socket;
fastcgi_intercept_errors off;
fastcgi_index test.py;
fastcgi_param SCRIPT_FILENAME /home/www/python$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /home/www/python;
fastcgi_param PHP_SELF $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_NAME pytest;
fastcgi_param HTTP_HOST pytest;
fastcgi_param SERVER_PORT 80;
fastcgi_param REMOTE_ADDR $remote_addr;
}
}
2009/04/03 12:40:06 [crit] 15019#0: *19 connect() to unix:/tmp/fcgi_wsgi.socket failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: pytest, request: "GET /test.py HTTP/1.1", upstream: "fastcgi://unix:/tmp/fcgi_wsgi.socket:", host: "pytest"
#!/usr/bin/env python
def myapp(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['Hello World!\n']
if __name__ == '__main__':
from flup.server.fcgi import WSGIServer
WSGIServer(myapp).run()
Отредактировано (Апрель 3, 2009 12:01:57)
Офлайн