Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized directive: listener_wrappers #9

Open
edelvalle opened this issue Nov 20, 2021 · 1 comment
Open

Unrecognized directive: listener_wrappers #9

edelvalle opened this issue Nov 20, 2021 · 1 comment

Comments

@edelvalle
Copy link

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?

@jyooru
Copy link

jyooru commented Jan 9, 2022

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants