【问题标题】:Haproxy running error?haproxy运行错误?
【发布时间】:2012-10-17 06:38:50
【问题描述】:

我使用的是 HA-Proxy 版本 1.3.22 和 Ubuntu 10.04。这是我的配置文件。

global
        maxconn     25000  
        daemon
        nbproc      4 



defaults
        mode        http
        clitimeout  60000
        srvtimeout  30000
        contimeout  4000
        timeout http-request 5s  
        option      httpclose 




listen  http_proxy *:80
        #bind *:80
        balance roundrobin 
        option httpchk
        option forwardfor 
        use_backend bk_web_static if { path_end .jpg .png .gif .css .js }
        default_backend bk_web 


backend bk_web  

        balance roundrobin ## change to URL hashing

        server server1 0.0.0.0:3002 weight 1 maxconn 512 check
        server server2 0.0.0.0:3003 weight 1 maxconn 512 check
        server server3 0.0.0.0:3004 weight 1 maxconn 512 check



backend bk_web_static
  balance roundrobin
        server server1 0.0.0.0:3002 weight 1 maxconn 1000 check
        server server2 0.0.0.0:3006 weight 1 maxconn 1000 check
        server server3 0.0.0.0:3007 weight 1 maxconn 1000 check

运行 haproxy 时出现以下错误。我在网上找到了这个配置代码。我猜该代码是针对某些最新版本的。请告诉我为了运行 haproxy 服务器我做了哪些更改。

 [ALERT] 290/100612 (2745) : parsing [/etc/haproxy/haproxy.cfg:24] : error detected while parsing switching rule.
[ALERT] 290/100612 (2745) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT] 290/100612 (2745) : Fatal errors found in configuration. 

【问题讨论】:

  • 请注明第24行???

标签: ubuntu haproxy


【解决方案1】:

在您的聆听会话中尝试使用此配置:

listen  http_proxy *:80
        balance roundrobin 
        option httpchk
        option forwardfor 

        acl is_static path_end -i .jpg .png .gif .css .js 
        use_backend bk_web_static if is_static

        default_backend bk_web

【讨论】:

    猜你喜欢
    • 2013-09-08
    • 2022-05-19
    • 2012-12-09
    • 2013-07-28
    • 2015-09-22
    • 1970-01-01
    • 1970-01-01
    • 2020-08-11
    • 1970-01-01
    相关资源
    最近更新 更多