仅 HAProxy returns 转发代理模式下的错误 500

HAProxy only returns error 500 in forward proxy mode

考虑这个最小的 HAProxy 2.0 配置

defaults
    timeout connect 5s
    timeout client 5s
    timeout server 5s
    option http_proxy
    mode http

frontend proxy_in
    bind :8000
    default_backend proxy_out

backend proxy_out
    option http_proxy

我原以为 HAProxy 会在端口 8000 上侦听 HTTP 代理请求(有不根据 documentation.

解析 IP 地址的限制)

不幸的是,我只收到错误 500:

$ curl -v -x localhost:8000 http://1.1.1.1
* Rebuilt URL to: http://1.1.1.1/
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8000 (#0)
> GET http://1.1.1.1/ HTTP/1.1
> Host: 1.1.1.1
> User-Agent: curl/7.54.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 500 Internal Server Error
< content-length: 96
< cache-control: no-cache
< content-type: text/html
< connection: close
<
<html><body><h1>500 Internal Server Error</h1>
An internal server error occured.
</body></html>

是我误解了 http_proxy 选项还是我的配置存在其他问题?

这看起来像是刚刚修复的错误 BUG/MEDIUM: http/htx: unbreak option http_proxy。您可以尝试使用此修复构建一个版本或等待下一个版本。