【问题标题】:docker + haproxy on mac 10.11.5 doesn't workmac 10.11.5 上的 docker + haproxy 不起作用
【发布时间】:2016-09-17 13:27:46
【问题描述】:

我在 mac 上运行 haproxy 配置,在 linux 上运行完美,但我什至无法让代理响应。这是我的配置:

defaults
    mode http
    timeout connect 5000ms
    timeout client 5000ms
    timeout server 5000ms

frontend http
    bind *:80
    acl oracle_content hdr(ContentType) -i  application/vnd.api+json
    acl oracle_accept hdr(Accept) -i  application/vnd.api+json
    use_backend oracle_be    if oracle_content
    use_backend oracle_be    if oracle_accept
    default_backend matrix_be


backend oracle_be
   balance roundrobin
   server oracle1 theoracle.stage.company.com:8080

backend matrix_be
   balance roundrobin
   server matrix1 192.168.1.6:3000

docker run -d --name cc -v /Users/cbongiorno/development/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro haproxy

docker -v

Docker version 1.12.0, build 8eab29e

唯一的机器特定配置是 matrix_be 条目的 IP 地址,它必须是我的本地接口。它不适用于 2 个 Mac,我尝试将代理绑定到多个接口。我什至没有收到 504,这表明代理很好,但其中一个后端服务配置错误。

想法?

【问题讨论】:

    标签: macos docker haproxy


    【解决方案1】:

    由于 mac limitations 上的当前 docker,即使容器声明端口 80 开放业务,也必须传递 -p 80:80 标志

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-24
      • 1970-01-01
      • 2017-01-01
      • 2012-09-23
      • 1970-01-01
      • 2019-09-04
      • 2014-12-07
      相关资源
      最近更新 更多