Json: unknown field "trusted_proxies"

caddy ver v2.4.6
Help me pls set up
“trusted_proxies”: [“0.0.0.0/0”]
option at json config file.
I use docs

but I always get error

loading module 'reverse_proxy': decoding module config: http.handlers.reverse_proxy: json: unknown field "trusted_proxies"
part of my conig

  caddy.json: |-
    {
      "logging": {
        "logs": {
          "main": {
            "writer": {
              "output": "stdout"
            }
          }
        }
      },
      "admin": {
        "disabled": true
      },
      "apps": {
        "http": {
          "servers": {
            "catchall": {
              "listen": [":443"],
              "routes": [
                {
                  "handle": [
                    {
                      "encodings": {
                        "gzip": {}
                      },
                      "handler": "encode"
                    }
                  ]
                },
                {
                  "match": [
                    {
                      "host": ["api.staging.t.com"],
                      "path_regexp": {
                        "name": "clicks-api",
                        "pattern": "^\\/1\\.[0-9]\\/clicks\\/$"
                      },
                      "method": ["POST"]
                    }
                  ],
                  "handle": [
                    {
                      "handler": "reverse_proxy",
                      "transport": {
                        "protocol": "http"
                      },
                      "upstreams": [
                        {
                          "dial": "node.k8s-stage-tracking-api-t.svc.cluster.local:80"
                        }
                      ],
                      "flush_interval": 0,
                      "trusted_proxies": [""],
                      "headers": {
                        "request": {
                          "add": {
                            "x-reverse-proxy-key": ["Th3secr3t"]
                          }
                        },
                        "response": {
                          "delete": ["Server"]
                        }
                      }
                    }
                  ]
                },

That feature was introduced in v2.5, so please upgrade Caddy :+1:

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.