其他分享
首页 > 其他分享> > ngnix 项目负载配置

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;
            
        }
    }
}

 

标签:负载,配置,log,header,ngnix,nginx,proxy,timeout,size
来源: https://www.cnblogs.com/chinazhou-wang/p/15535923.html