caddy2-proxyprotocol icon indicating copy to clipboard operation
caddy2-proxyprotocol copied to clipboard

Unrecognized directive: listener_wrappers

Open edelvalle opened this issue 3 years ago • 1 comments

After compiling caddy with this plugin:

$ xcaddy build --with github.com/mastercactapus/caddy2-proxyprotocol

And trying to validate:

$ caddy validate --config Caddyfile --adapter caddyfile

This Caddyfile:

app.example.com {
	listener_wrappers {
		proxy_protocol {
			timeout 2s
			allow 0.0.0.0/0
		}
		tls
	}
	reverse_proxy backend:3000
}

I'm getting the error: Unrecognized directive: listener_wrappers

Why is this? I'm I using the syntax wrong? Did I compile caddy wrong?

edelvalle avatar Nov 20 '21 14:11 edelvalle

listener_wrappers has to be put in the global options block:

{
	servers {
		listener_wrappers {
			proxy_protocol {
				timeout 2s
				allow 0.0.0.0/0
			}
			tls
		}
	}
}

app.example.com {
	reverse_proxy backend:3000
}

jyooru avatar Jan 09 '22 06:01 jyooru