Use error 418 instead of error 403

1. The problem I’m having:

I am trying to make caddy use error 418 (I’m a teapot) instead of error 403.

2. Error messages and/or full log output:

3. Caddy version:

v2.8.0-beta2

4. How I installed and ran Caddy:

a. System environment:

Windows 11

b. Command:

caddy run

c. Service/unit/compose file:

d. My complete Caddy config:

fishyfish.go.ro

root * D:\Vlad\websites\fish
file_server
handle_errors {
	rewrite * /{http.error.status_code}.html
	file_server
}

5. Links to relevant resources:

I’m not sure I understand. When are you getting a 403?

You can override the status code that file_server writes using the status_code option. See the docs.

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