zoukankan      html  css  js  c++  java
  • Nginx Backup配置

    /etc/nginx/nginx.conf

    http {
        include       mime.types;
        default_type  application/octet-stream;
    
        sendfile        on;
        keepalive_timeout  65;
    
        upstream tomcat1{
            server [ip_addr]:8081 weight=1 max_fails=3 fail_timeout=10s;
    	server [ip_addr]:8082 weight=1 max_fails=3 fail_timeout=10s backup;
        }
        upstream tomcat2{
            server [ip_addr]:8082 weight=1 max_fails=3 fail_timeout=10s;
            server [ip_addr]:8081 weight=1 max_fails=3 fail_timeout=10s backup;
        } 
    
        server {
            listen       80;
            server_name  [ip_addr];
            error_log /var/log/nginx/demo.error.log;
    
            location /index {
    	    proxy_pass http://tomcat2;
    	    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_redirect off;
    	}
    
            location / {
                proxy_pass http://tomcat1;
    	    proxy_read_timeout 20;
            }
    
        error_page  404 403 500 502 503 504  /404.html;
            location = /404.html {
                root   /usr/local/nginx-1.14.0/html;
            }
        }
    }
    
  • 相关阅读:
    [大山中学模拟赛] 2016.9.17
    [DP优化方法之斜率DP]
    Gengxin讲STL系列——String
    小班讲课之动态规划基础背包问题
    ubuntu安装体验
    小班出题之字符串基础检测
    G
    B
    小项目--反eclass
    树--天平问题
  • 原文地址:https://www.cnblogs.com/lich1x/p/15738098.html
Copyright © 2011-2022 走看看