Caddy import configs not working correct

Hi guys!
I need help!
I wrote a template generator wirth caddy hosts, base this:
$domain:80 www.domain:80 {
bind $ip
proxy / {
transparent
}
}

I generate more templates emample this:
domain.com:80 www.domain.com:80 {
bind 127.0.0.5
proxy / {
transparent
}
}

I set caddyfile this string:
import /root/0/*

I see an error when starting caddy:
/root/0/domain.com:5 - Error during parsing: Wrong argument count or unexpected line ending after ‘}’

Please help to fix this

At a guess, I’d have to assume proxy / { transparent } is your issue.

The proxy directive needs to have an upstream server specified here.

https://caddyserver.com/docs/proxy

caddy
Activating privacy features… done.
/root/0/domain.com:3 - Error during parsing: Wrong argument count or unexpected line ending after ‘}’

domain.com:80 www.domain.com:80 {
bind 127.0.0.2
proxy / { transparent } - this string is 3
}

Sorry, no, the proxy block doesn’t actually condense down to one line - I was just referring to it in your own example. It needs to be three lines if you add subdirectives like transparent. But it needs three tokens on its first line, before the opening brace.

Read the directive’s documentation for correct usage:

https://caddyserver.com/docs/proxy

Thank you, i find bug, no specified ip backend server

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.