nainai1 发表于 2018-11-14 09:48:10

keepalived+nginx+apache双活搭建(双网卡模式)

# more /usr/local/nginx/conf/nginx.conf  
#usernobody;
  
worker_processes1;
  
#error_loglogs/error.log;
  
#error_loglogs/error.lognotice;
  
#error_loglogs/error.loginfo;
  
#pid      logs/nginx.pid;
  
events {
  
    worker_connections1024;
  
}
  
http {
  
    include       mime.types;
  
    default_typeapplication/octet-stream;
  
    #log_formatmain'$remote_addr - $remote_user [$time_local] "$request" '
  
    #                  '$status $body_bytes_sent "$http_referer" '
  
    #                  '"$http_user_agent" "$http_x_forwarded_for"';
  
    #access_loglogs/access.logmain;
  
    sendfile      on;
  
    #tcp_nopush   on;
  
    #keepalive_timeout0;
  
    keepalive_timeout65;
  
    #gzipon;
  
    upstream webser{
  
             server 172.27.9.125:1180;
  
             server 172.27.9.126:1180;
  
             server 172.27.18.127:1180;
  
             server 172.27.18.128:1180;
  
         }
  
    server {
  
      listen       82;
  
      server_namelocalhost;
  
      #charset koi8-r;
  
      #access_loglogs/host.access.logmain;
  
      location / {
  
            proxy_pass http://webser;
  
            #root   html;
  
            #indexindex.html index.htm;
  
      }
  
      error_page   500 502 503 504/50x.html;
  
      location = /50x.html {
  
            root   html;
  
      }
  
    }
  
}


页: [1]
查看完整版本: keepalived+nginx+apache双活搭建(双网卡模式)