• nginx gzip json [2]


    
    node1:/etc/nginx#cat nginx.conf
    worker_processes  1;
    
    #error_log  logs/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    
    events {
        worker_connections  1024;
    }
    
    # http conf
    http {
        #include     http/common.conf;
        #include     http/cache.conf;
        #include     http/resty.conf;
        #include     http/mime.types;
    
        include     http/*.conf;
    
        include     http/servers/*.conf;
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for" "$request_filename"';
         gzip on;
         gzip_min_length 1000;
         gzip_buffers 4 8k;
         gzip_types text/plain application/x-javascript text/css application/json application/xml text/javascript;
        access_log  logs/access.log  main;  
          include /etc/nginx/conf/*.conf;
            }
    
    
    
    
    
    
    node1:/etc/nginx/conf#cat test.conf 
    
     upstream backend1 {
        server 192.168.137.3:9000      weight=5;
        }
    server {
      listen       8090;
            server_name  localhost;
     location  /
                     {
                      proxy_pass http://backend1;
                      proxy_connect_timeout 300;
                      proxy_send_timeout 300;
                      proxy_read_timeout 300;
                      proxy_set_header   Host             $host;
                      proxy_set_header   X-Real-IP        $remote_addr;       
                      proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
     }
    }
    
    
  • 相关阅读:
    Oracle建立表空间和用户
    Session详解
    Spring中AOP方式实现多数据源切换
    Filter(过滤器)学习
    不用加号运算
    数字转化为十六进制
    1px像素问题(移动端经典问题)
    对postcss-plugin-px2rem的研究
    npm cache clean --force
    对async/await的研究
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348314.html
Copyright © 2020-2023  润新知