AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1030129
Accepted
QkiZ
QkiZ
Asked: 2020-08-15 05:15:28 +0800 CST2020-08-15 05:15:28 +0800 CST 2020-08-15 05:15:28 +0800 CST

前端部分中的 Haproxy 未知关键字绑定 *:80

  • 772

我使用以下命令从源代码编译了 Haproxy LTS 2.2 版本:

make TARGET=linux-glibc USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_CRYPT_H=1 USE_LIBCRYPT=1

编译过程中没有错误。这是我的 Haproxy 配置:

global
    log         127.0.0.1 local2

    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     4000
    user        haproxy
    group       haproxy
    daemon
    
    # turn on stats unix socket
    stats socket /var/lib/haproxy/stats

defaults
    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
    option http-server-close
    option forwardfor       except 127.0.0.0/8
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout http-keep-alive 10s
    timeout check           10s
    maxconn                 3000

frontend http-in
        bind 192.168.123.40:80
        acl gerrit hdr(host) -i gerrit.example.local
        acl jenkins hdr(host) -i jenkins.example.local
        use_backend gerrit if gerrit
        use_backend jenkins if jenkins

backend gerrit
        server gerrit 127.0.0.1:8080

backend jenkins
        server jenkins 127.0.0.1:8081

当我使用haproxy -c -q -V -f /etc/haproxy/haproxy.cfg命令检查配置时,出现以下错误:

[NOTICE] 226/130914 (35193) : haproxy version is 2.2.2
[NOTICE] 226/130914 (35193) : path to executable is /usr/sbin/haproxy
[ALERT] 226/130914 (35193) : parsing [/etc/haproxy/haproxy.cfg:33] : unknown keyword 'bind 192.168.123.40:80' in 'frontend' section
[ALERT] 226/130914 (35193) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT] 226/130914 (35193) : Fatal errors found in configuration.

我检查了文档,它允许bind在前端部分使用关键字 http://cbonte.github.io/haproxy-dconv/2.2/configuration.html#bind (按字母顺序排序的关键字参考)

当我在前端部分注释掉bind关键字时,实现了更多的mindfuck。然后错误说:

[WARNING] 226/132456 (36642) : config : frontend 'http-in' has no 'bind' directive. Please declare it as a backend if this was intended.?

documentation haproxy
  • 1 1 个回答
  • 1752 Views

1 个回答

  • Voted
  1. Best Answer
    Michael Hampton
    2020-08-15T06:03:30+08:002020-08-15T06:03:30+08:00

    这看起来像您使用了其他一些看起来像空格的空白字符,但实际上不是正常的空格字符,在bindand之间192.168.123.40:80。尝试再次输入文本,但这次使用常规空格(U+0020,ASCII 32)。

    • 2

相关问题

  • 如何交付 IT 工具的文档?

  • 在活动目录服务器中记录什么是重要的?

  • 教程/培训创建工具[关闭]

  • 您如何记录您的工作、流程和环境?

  • 您希望开发人员向您提供什么级别的文档?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve