小编Rud*_*Lee的帖子

HAProxy 作为 AWS API Gateway 的反向代理

正如标题所暗示的,我有一个 AWS API Gateway 端点,我想将它放在 HAProxy 后面。

这是我当前的 HAProxy 配置

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

listen  http
        bind 127.0.0.1:8080
        maxconn     18000

        acl api_gateway path_beg /api-gateway
        use_backend api-gateway-backend if api-gateway

backend api-gateway-backend
        http-request set-header Host xxxxx.execute-api.ap-southeast-2.amazonaws.com
        server api-gateway xxxxx.execute-api.ap-southeast-2.amazonaws.com:443
Run Code Online (Sandbox Code Playgroud)

当我点击/api-gatewayHAProxy 上的端点时,我得到400 …

haproxy amazon-web-services amazon-api-gateway

2
推荐指数
1
解决办法
3065
查看次数