ngnix 项目负载配置

user  nginx;
worker_processes  4;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    access_log  /var/log/nginx/access.log;
    
   
    sendfile        on;
   

    # keepalive_timeout  0;
    keepalive_timeout  65;
    
    proxy_connect_timeout 300s;
    proxy_send_timeout 300s;
    proxy_read_timeout 300s;
    send_timeout 300s;

    proxy_buffer_size 64k;
    proxy_buffers 4 64k;
    proxy_busy_buffers_size 128k;
    proxy_temp_file_write_size 128k;

    proxy_ignore_client_abort on;

            
        client_max_body_size 8M;
        client_body_buffer_size 128k;
        fastcgi_intercept_errors on;
  
    underscores_in_headers on;

   

    include /etc/nginx/conf.d/*.conf;

    upstream myserver {
        server 15.1.48.52:7000 ;
        server 15.1.48.58:7000 ;
    }

    server {
        listen       7000;
        server_name 15.1.48.26;
        

        
        #proxy_redirect off;
        #add_header Set-Cookie 'KOAL_CLIENT_IP=$remote_addr';

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


        location / {
            proxy_pass http://myserver;
            #proxy_set_header Host $host;
            #proxy_set_header X-Real-IP $remote_addr;
            #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            #proxy_set_header x-Forwarded-Proto $scheme;
            
        }
    }
}

 

posted @ 2021-11-10 21:57  _万古如长夜  阅读(63)  评论(1编辑  收藏  举报