Chinaunix首页 | 论坛 | 博客
  • 博客访问: 291444
  • 博文数量: 80
  • 博客积分: 1933
  • 博客等级: 上尉
  • 技术积分: 915
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-09 08:43
个人简介

高龄IT运维工程师

文章分类
文章存档

2023年(5)

2021年(3)

2020年(1)

2019年(2)

2018年(3)

2017年(3)

2016年(5)

2014年(3)

2013年(2)

2012年(11)

2011年(12)

2010年(30)

分类: LINUX

2018-11-19 09:42:35

#user  nobody;
worker_processes  10;
worker_rlimit_nofile 655350;
error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
pid        logs/nginx.pid;
tcp_nodelay on
events {
    use epoll;
    worker_connections   10240;
 
}

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;
    sendfile        on;
    #tcp_nopush     on;
    #keepalive_timeout  0;
    keepalive_timeout  30;
    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
    fastcgi_buffer_size 64k;
    fastcgi_buffers 8 128k;
    fastcgi_busy_buffers_size 128k;
    fastcgi_temp_file_write_size 128k;
    gzip  on;
   
    upstream *.*.*.*{
    ip_hash;
#    server 192.168.1.4:8080;
#    server 192.168.1.3:8080;
#    server 192.168.1.12:8080;
#    server 192.168.1.13:8080;
    server 192.168.1.14:8080 weight=5 max_fails=2 fail_timeout=600s;
    server 192.168.1.15:8080 weight=5 max_fails=2 fail_timeout=600s;
    server 192.168.1.16:8080 weight=5 max_fails=2 fail_timeout=600s;
#    server 192.168.1.17:8080 weight=5 max_fails=2 fail_timeout=600s;
   }
    server {
        listen       80;
        server_name  192.168.1.2;
       
        #charset koi8-r;
       #access_log  logs/host.access.log  main;
        location / {
            root   html;
            index  index.html index.htm;
            proxy_pass http://*.*.*.*;
            proxy_redirect off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            client_max_body_size 10000m;
            client_body_buffer_size 128k;
            proxy_connect_timeout 15;
            proxy_read_timeout 600;
            proxy_send_timeout 600;
            proxy_buffer_size 4k;
            proxy_buffers 6 32k;
            proxy_busy_buffers_size 64k;
            proxy_temp_file_write_size 64K;
        }
        #error_page  404              /404.html;
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass  
        #}
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}
        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;
    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;
    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;
    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;
    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}
}
阅读(10687) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~