Доброе время суток. Я уже обращался к вам с проблемой http://python.com.ua/forum/viewtopic.php?id=1384 переделал но при загрузке главной страницы бросает почему то ошыбку:
502 Bad Gateway
nginx/0.6.14
уже все перепробовал. как конфиг правильный но увы.
посмотрите пожалуйста что не так.
Конфиг:
pid /home/gnat/projects/my_site/log/nginx.pid;
worker_processes 2;
error_log /home/gnat/projects/my_site/log/error_log info;
events {
worker_connections 1024;
use epoll;
}
http {
# default nginx location
include /usr/local/nginx/mime.types;
default_type application/octet-stream;
log_format main
'$remote_addr - $remote_user ‘
’“$request” $status $bytes_sent ‘
’“$http_referer” “$http_user_agent” ‘
’“$gzip_ratio”';
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
connection_pool_size 512;
client_header_buffer_size 1024k;
large_client_header_buffers 4 2k;
request_pool_size 1024k;
output_buffers 4 32k;
postpone_output 1460;
sendfile on;
tcp_nopush on;
keepalive_timeout 75 20;
tcp_nodelay on;
client_max_body_size 10m;
client_body_buffer_size 1024k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
client_body_temp_path /home/gnat/projects/my_site/log/client_body_temp;
proxy_temp_path /home/gnat/projects/my_site/log/proxy_temp;
fastcgi_temp_path /home/gnat/projects/my_site/log/fastcgi_temp;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain text/html application/x-javascript text/xml text/css;
ignore_invalid_headers on;
server {
listen 10.17.5.78:8000;
server_name localhost;
index index.html;
root /home/gnat/projects/my_site;
# static resources
location ~* ^.+\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$
{
expires 30d;
break;
}
location / {
# host and port to fastcgi server
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
fastcgi_pass unix:/log/odbreak.sock;
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_PORT $server_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_SOFTWARE “nginx”;
fastcgi_param GATEWAY_INTERFACE “CGI/1.1”;
}
location /403.html {
root /usr/local/nginx;
access_log off;
}
location /401.html {
root /usr/local/nginx;
access_log off;
}
location /404.html {
root /usr/local/nginx;
access_log off;
}
location = /_.gif {
empty_gif;
access_log off;
}
access_log /home/gnat/projects/my_site/log/localhost.access_log main;
error_log /home/gnat/projects/my_site/log/localhost.error_log;
}
}
запускаю ето все дело так:
python ./manage.py runfcgi –settings=my_site.settings maxchildren=10 maxspare=5 minspare=2 method=prefork socket=/home/gnat/projects/my_site/log/django.sock pidfile=/home/gnat/projects/my_site/log/django.pid
что надо дописать говорите, допишу …. я в етом новачок но хотелось попробовать ….
Заранее спасибо!