caddy -version)?0.9.3
remove a header when using caddy to proxy
http://example.com:881 {
proxy / http://localhost:3333 {
header_downstream -server
}
}
via systemd because I like to maintain my own /usr/local/lib/systemd/system/caddy.service.
caddy to start, and the server header to be removed from proxy'd responses.
caddy refuses to start, and the following error is logged:
Parse error: Wrong argument count or unexpected line ending after '-server'
When removing a header, the value should be optional; it seems that caddy thinks its mandatory.
header_downstream name value
should really be
header_downstream { ["+"]name value | "-"name }
If I provide a bogus second parameter, i.e. header_downstream -server bogus in my caddy file, then caddy starts and will quite happily update the server header, but replaces it with the default of "Caddy" instead of removing it. As a temporary solution I do header_downstream server Apache to simply overwrite what the proxy is returning, but ideally -server would work to remove the entry.
header_downstream { ["+"]name value | "-"name } is reasonable. Will work out a patch soon.Caddy header. What about the status code? (200? 404?)header_downstream -server whatever the code does the equivalent of (whether deliberate or accidental) of header_downstream Server Caddy. I suspect that this is accidental because there are a few other occasions where this happens.Server Caddy) is preset by caddy before proxy. The header_downstream only influence the headers of proxy backend's response. So I think you should use header -Server instead.Oh, yes, that's correct -- header_downstream -Server will remove a header coming back downstream but not affect headers set by the local instance. I think keeping those two controls separate is an important distinction.