user  root;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
#error_log  "pipe:rollback logs/error_log interval=1d baknum=7 maxsize=2G";

#pid        logs/nginx.pid;

events {
    worker_connections  1024;
}
# load modules compiled as Dynamic Shared Object (DSO)
#
#dso {
#    load ngx_http_fastcgi_module.so;
#    load ngx_http_rewrite_module.so;
#}

http {
    include       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  logs/access.log  main;
    #access_log  "pipe:rollback logs/access_log interval=1d baknum=7 maxsize=2G"  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    server_tokens off;    #屏蔽tengine的版本信息

    server_names_hash_bucket_size 128;
    client_header_buffer_size 32k;
    large_client_header_buffers 4 32k;
    client_max_body_size 1000m;    #限制客户端最大上传文件大小
    limit_rate 1024k;    #限制客户端上传速度

    gzip on;    #启用gzip压缩
    gzip_buffers 4 16k;
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/javascript;
    gzip_vary on;
    #upstream zcms {    ##定义后端tomcat负载均衡组
    #ip_hash;    #启用源ip哈希的负载策略,相同源ip的客户端负载至同一个tomcat服务器
    #server 192.168.1.2:8080;    #定义tomcat服务
    #server 192.168.1.3:8080;
    #}
    upstream zcms{
        server 127.0.0.1:8080;   #用于代理的服务器地址
    }

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;
        #access_log  "pipe:rollback logs/host.access_log interval=1d baknum=7 maxsize=2G"  main;

        access_log logs/access.log;
        error_log logs/error.log;
        ssi on;    #开启ssi支持
        ssi_types text/shtml;
        location / {
            root   /web/wwwroot_release/News;
            index  index.shtml  index.html index.htm;
        }

        #error_page  404              /404.html;
        location /zcms{
             proxy_pass http://127.0.0.1:8080/;
             proxy_redirect    off;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header Host $http_host;

        }
        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    proxy_buffer_size 1024k;
    proxy_buffers   32 1024k;
    proxy_busy_buffers_size 1024k;
    proxy_temp_file_write_size 1024k;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $http_host;
    }
}