Hi, I need to respond all 404 pages error to 410. As for example, I have following configuration:
@404 {
header 404 ← Will this work if not how to accomplish
}
respond @404 410
Can somebody please help me change all 404 response to 410. Everything is all right, only I don’t know how to denote 404 header on Caddy 2 configuration.
Given that 404 is within the error range (> 400), then your respond must be used within the handle_errors directive. So you will need something like this:
Connection timeout means your client never even managed to contact Caddy successfully. You will almost never see a connection timeout caused by configuring handlers! More often it might happen if you mistakenly manipulate the site label (i.e. by specifying the wrong port or scheme) or from networking/DNS issues.