HAProxy-1.8.20 根据后缀名转发到后端服务器
Posted 风满楼9527
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HAProxy-1.8.20 根据后缀名转发到后端服务器相关的知识,希望对你有一定的参考价值。
global
maxconn 100000
chroot /data/soft/haproxy
stats socket /var/lib/haproxy/haproxy.sock mode 600 level admin
uid 1000
gid 1000
daemon
nbproc 2
cpu-map 1 0
cpu-map 2 1
pidfile /usr/local/haproxy/run/haproxy.pid
log 127.0.0.1 local3 info
defaults
option http-keep-alive
option forwardfor # ip地址透传 针对http 协议有效
maxconn 100000
mode http
timeout connect 300000ms
timeout client 300000ms
timeout server 300000ms
################ 重点配置 ################
frontend web_prot_80
bind 0.0.0.0:80
mode http
acl image_port path_end -i .jpg
acl php_port path_end -i .php
use_backend image_nodes if image_port
use_backend php_nodes if php_port
default_backend backup_nodes
backend image_nodes
server server1 10.10.29.207:80 weight 1 check port 80 inter 3s fall 2 rise 5
backend php_nodes
server server2 10.10.4.209:80 weight 1 check port 80 inter 3s fall 2 rise 5
backend backup_nodes
server server3 10.10.116.206:80 weight 1 check port 80 inter 3s fall 2 rise 5
以上是关于HAProxy-1.8.20 根据后缀名转发到后端服务器的主要内容,如果未能解决你的问题,请参考以下文章