error_log/var/log/nginx/error_loginfo;
events{
worker_connections1024;
useepoll;
}
http{
include/etc/nginx/mime.types;
default_typeapplication/octet-stream;
log_formatmain
'$remote_addr-$remote_user[$time_local]'
'"$request"$status$bytes_sent'
'"$http_referer""$http_user_agent"'
'"$gzip_ratio"';
client_header_timeout10m;
client_body_timeout10m;
send_timeout10m;
connection_pool_size256;
client_header_buffer_size1k;
large_client_header_buffers42k;
request_pool_size4k;
gzipon;
gzip_min_length1100;
gzip_buffers48k;
gzip_typestext/plain;
output_buffers132k;
postpone_output1460;
sendfileon;
tcp_nopushon;
tcp_nodelayon;
keepalive_timeout7520;
ignore_invalid_headerson;
indexindex.html;
server{
listen80;
server_namelocalhost;
access_log/var/log/nginx/sn.access.log;
#location^~/media/{
# alias/home/test/project/media/;
#}
#对下面语句的解释,意思是指定文件的位置。是一个正则表达式~*表示正则表式是不区分大小写的
#^代表正则表达式的开头,点(.)代表任意字符,加好(+)表示一个或者多个,后面为在诸多字符串中选择一个,最后的$代表正则结束
location~*^.+.(gif|png|jpg|jpeg|css|swf|htm|html|asp|php|jsp|js|doc|txt)${
root/home/test/project/templates/;
#access_logoff;
}
#所有不是以以上扩展名结束的请求全部被转发到监听在8000端口的fastcgi守候进程
location/{
#hostandporttofastcgiserver
fastcgi_pass127.0.0.1:8000;
#fastcgi_passunix:/tmp/django.sock;
fastcgi_paramPATH_INFO$fastcgi_script_name;
fastcgi_paramREQUEST_METHOD$request_method;
fastcgi_paramQUERY_STRING$query_string;
fastcgi_paramCONTENT_TYPE$content_type;
fastcgi_paramCONTENT_LENGTH$content_length;
fastcgi_pass_headerAuthorization;
fastcgi_paramREMOTE_ADDR$remote_addr;
fastcgi_paramSERVER_PROTOCOL$server_protocol;
fastcgi_paramSERVER_PORT$server_port;
fastcgi_paramSERVER_NAME$server_name;
fastcgi_intercept_errorsoff;
}
}
}
声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。