zoukankan      html  css  js  c++  java
  • haproxy web通过根跳转

    frontend web_service
    
    	bind	*:80
    	mode	http
    	log	global
    	option	httplog
    	option	httpclose
    	option	forwardfor
    
    	acl	inside_src path_beg -i /inside	
    	use_backend	inside_servers if inside_src
    
    	default_backend	external_servers
    backend external_servers
    	mode	http	
    	balance	roundrobin
    	option	httpchk GET /index.html
    	server	web1 192.168.32.75:8080 cookie web1 check inter 2000 rise 2 fall 3 weight 1
    	server	web2 192.168.32.74:80 cookie web2 check inter 2000 rise 2 fall 3 weight 1
    
    backend inside_servers
    	mode	http
    	balance	roundrobin
    	server	web3 192.168.32.73:80 check inter 1500 rise 3 fall 3
    
    
    
    haproxy 80跳转80:
    
    192.168.32.73 上的配置:
    
    demo:/root# cat /etc/httpd/conf/httpd.conf | grep 80
    #Listen 12.34.56.78:80
    Listen 80
    
    demo:/root# cat /etc/httpd/conf/httpd.conf | grep html
    # <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
    # (available at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
    DocumentRoot "/var/www/html"
    <Directory "/var/www/html">
    
    
    如果haproxy 需要通过/inside	访问, 那么192.168.32.73上需要建立inside目录
    
    
    demo:/var/www/html/inside# pwd
    /var/www/html/inside
    demo:/var/www/html/inside# ls
    index.html

  • 相关阅读:
    open-falcon之agent
    centos 7 部署 open-falcon 0.2.0
    高可用Redis服务架构分析与搭建
    python操作mongo脚本
    mongo查询日期格式数据
    离线下载pip包安装
    mongo同步到es
    mongo ttl索引
    kibana多台服务部署
    logstash过滤配置
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351160.html
Copyright © 2011-2022 走看看