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 @   _万古如长夜  阅读(64)  评论(1编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
点击右上角即可分享
微信分享提示