码迷,mamicode.com
首页 > 其他好文 > 详细

nginx gzip 以及 tcp 反向代理的 model

时间:2019-02-23 10:25:25      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:1.2   cat   lis   ash   java   model   forward   RoCE   prot   

同事为了提高性能发给我一model 简单改了一下. 记录一下

#user  nobody;
worker_processes  1;

events 
{
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;


gzip on;
gzip_min_length 1k;
gzip_buffers 16 64k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain application/x-javascript application/javascript text/javascript text/css application/xml;
gzip_vary on;

    
    upstream webservers {
        server 10.24.13.6:80 weight=10;
        server 10.24.12.112:80 weight=10;
    }

    server {
        listen  4443 ssl;
        ssl_certificate d:\Work\ca\Servercert.pem;
        ssl_certificate_key d:\Work\ca\Serverkey.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1.2;
        ssl_prefer_server_ciphers on;
        server_name  localhost;
        root         /usr/share/nginx/html;
        proxy_buffer_size   128k;
        proxy_buffers   4 256k;
        proxy_busy_buffers_size   256k;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        location /
        {
            add_header ‘Access-Control-Allow-Origin‘ "$http_origin";
            add_header ‘Access-Control-Allow-Credentials‘ "true";
            proxy_pass http://webservers;
         }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

stream
{ server 
{ listen
82;
proxy_pass app; }
upstream app {
 hash $remote_addr consistent;

server 10.24.160.61:80;
server 10.24.160.71:80; } }

 

nginx gzip 以及 tcp 反向代理的 model

标签:1.2   cat   lis   ash   java   model   forward   RoCE   prot   

原文地址:https://www.cnblogs.com/jinanxiaolaohu/p/10418319.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!