免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: rjxylq
打印 上一主题 下一主题

请教nginx部署Django的问题。在线等。。。 [复制链接]

论坛徽章:
0
2 [报告]
发表于 2010-05-25 15:34 |只看该作者
回复 1# rjxylq
上面Nginx的配置文件如下:
user              nginx;
worker_processes  1;

error_log         /var/log/nginx/error.log;
#error_log        /var/log/nginx/error.log  notice;
#error_log        /var/log/nginx/error.log  info;

pid               /var/run/nginx.pid;


#----------------------------------------------------------------------
# Events Module
#
#   http://wiki.codemongers.com/NginxEventsModule
#
#----------------------------------------------------------------------

events {
    worker_connections  1024;
}
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] $request '
                      '"$status" $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    # Load config files from the /etc/nginx/conf.d directory
    include /etc/nginx/conf.d/*.conf;

    #
    # The default server
    #

    server {
        listen       80;
        #server_name  _;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {

            fastcgi_pass 127.0.0.1:8000;
            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  GATEWAY_INTERFACE  CGI/1.1;
            fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
            fastcgi_param  REMOTE_ADDR        $remote_addr;
            fastcgi_param  REMOTE_PORT        $remote_port;
           fastcgi_param  SERVER_ADDR        $server_addr;
            fastcgi_param  SERVER_PORT        $server_port;
            fastcgi_param  SERVER_NAME        $server_name;

#            fastcgi_param SERVER_PROTOCOL $server_protocol;

#            fastcgi_param SERVER_PORT $server_port;

#            fastcgi_param SERVER_NAME $server_name;

            fastcgi_pass_header Authorization;

            fastcgi_intercept_errors off;

           # root   /usr/share/nginx/html;
           # index  index.html index.htm;
        }

        error_page  404              /404.html;
        location = /404.html {
            root   /usr/share/nginx/html;
        }

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }
}
}
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP