zoukankan      html  css  js  c++  java
  • nginx 配置文件(linux)

    1. nginx.conf
      1. user www www;
        worker_processes  8;
        
        #error_log  logs/error.log;
        #error_log  logs/error.log  notice;
        #error_log  logs/error.log  info;
        
        #pid        logs/nginx.pid;
        worker_rlimit_nofile 51200;
        
        
        events {
            use epoll;
            worker_connections  1024;
        }
        
        
        http {
            include       mime.types;
            default_type  application/octet-stream;
        
            log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                              '$status $body_bytes_sent "$http_referer" '
                              '"$http_user_agent" "$http_x_forwarded_for"';
        
            #access_log  logs/access.log  main;
        
            sendfile        on;
            #tcp_nopush     on;
        
            #keepalive_timeout  0;
            keepalive_timeout  120;
            tcp_nodelay        on;
        
            #gzip  on;
            #gzip_disable "MSIE [1-6].(?!.*SV1)";
            
            client_header_buffer_size    8k;
            large_client_header_buffers  4 8k;
        
            include /opt/conf/nginx/nginx-test.conf;
        }
    2. /opt/conf/nginx/nginx-test.conf
      1.   
         upstream base{
                server ***.***.***.138:8001;
                server ***.***.***.142:8001;
            }
                   
            upstream instock{
                server ***.***.***.140:8001;
                server ***.***.***.144:8001;
            }
        
            upstream stock{
                server ***.***.***.140:8002;
                server ***.***.***.144:8002;
            }
        
            upstream outstock{
                server ***.***.***.138:8002;
                server ***.***.***.142:8002;
            }
            
         
            server {
               listen       80;     
                server_name  gzwhwms.womaiapp.com;
        
                if (-d $request_filename){
                        rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
                }
        
                location ~ ^/(WEB-INF)/ {
                         deny all;
                }
        
                #location ~ .*.(up|do|jsp|action|jhtml)?$ {
                location /outstock/ {
                    root /opt/www/outstock-web/defalut;
                    charset utf-8;
                    index   index.jsp index.action;
                    proxy_pass http://outstock;
                    include /opt/conf/nginx/proxy-resin.conf;
                }
                location /instock/ {
                    root /opt/www/instock-web/defalut;
                    charset utf-8;
                    index   index.jsp index.action;            
                    proxy_pass http://instock;
                    include /opt/conf/nginx/proxy-resin.conf;
                }
                location /stock/ {
                    root /opt/www/stock-web/defalut;
                    charset utf-8;
                    index   index.jsp index.action;
                    proxy_pass http://stock;
                    include /opt/conf/nginx/proxy-resin.conf;
                }
                location / {
                    root /opt/www/base-web/defalut;
                    charset utf-8;
                    index   index.jsp index.action;
                    proxy_pass http://base;
                    include /opt/conf/nginx/proxy-resin.conf;
                }
        
                access_log  /opt/logs/nginx/test/access.log  main;
                error_log   /opt/logs/nginx/test/error.log;
        
            }
    3. 
      
  • 相关阅读:
    《网络对抗技术》exp7 网络欺诈防范
    《网络对抗技术》exp6 MSF基础应用
    《网络对抗技术》exp5 信息搜集与漏洞扫描
    《网络对抗技术》exp4 恶意代码分析
    《网络对抗技术》Exp3 免杀原理与实践
    《网络对抗技术》exp2 简单后门
    k8s弹性伸缩
    python常见算法
    JavaScript 中创建对象的方法(读书笔记思维导图)
    JavaScript 中的闭包和作用域链(读书笔记)
  • 原文地址:https://www.cnblogs.com/wangzhanhua/p/10362251.html
Copyright © 2011-2022 走看看