首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HAProxy解析错误

HAProxy解析错误
EN

Server Fault用户
提问于 2015-06-20 08:46:15
回答 1查看 5.4K关注 0票数 1

我有3台服务器

代码语言:javascript
复制
--> haproxy - server1(uk)
            - server2(ru)

我遵循本教程并为ru.subnets创建了ip

现在,在我的/etc/ have中,我有以下文件:

代码语言:javascript
复制
haproxy.conf
ru.subnets

在我的haproxy.conf:

代码语言:javascript
复制
frontend http-frontend
    bind  *:80
    mode http
    reqadd X-Forwarded-Proto:\ http

    acl blog_acl path_beg /wp-admin

    acl ru_acl  src -f  RU.subnets

   use_backend wwwru  if ru_acl
    use_backend wwwbackend if !ru_acl

    use_backend wwwru  if blog_acl

    default_backend wwwbackend

一切看起来都还好,但是当我试图在okay中加载配置文件时,我会得到以下错误:

代码语言:javascript
复制
[ALERT] 170/084453 (4661) : parsing [/etc/haproxy/haproxy.cfg:37] : error detected while parsing ACL 'ru_acl'.
[ALERT] 170/084453 (4661) : parsing [/etc/haproxy/haproxy.cfg:39] : error detected while parsing switching rule.
[ALERT] 170/084453 (4661) : parsing [/etc/haproxy/haproxy.cfg:40] : error detected while parsing switching rule.
[ALERT] 170/084453 (4661) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT] 170/084453 (4661) : Fatal errors found in configuration.
EN

回答 1

Server Fault用户

发布于 2015-06-21 18:32:32

试一试:)

代码语言:javascript
复制
frontend http-frontend
    bind  *:80
    mode http
    reqadd X-Forwarded-Proto:\ http

    acl blog_acl path_beg /wp-admin

    use_backend wwwru  if { src -f RU.subnets }
    use_backend wwwbackend { src -f RU.subnets }

    use_backend wwwru  if blog_acl

    default_backend wwwbackend
票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/700403

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档