Migration for caddy v1 to v2 - unrecognized directive: internal

1. The problem I’m having:

We are migrating from v1 to v2
we using http.internal to protect from external requests but face issue

To protect all contents of /internal from being served directly:

internal /internal

Part of an example Caddyfile that protects some resources but allows a proxy to grant access to them (the service listening on :9000 must set X-Accel-Redirect):

internal /internal proxy /redirect http://localhost:9000

2. Error messages and/or full log output:

configuration",“config_file”:“/etc/caddy/Caddyfile”,“config_adapter”:“”} ││ Error: adapting config using caddyfile: /etc/caddy/Caddyfile:40: unrecognized directive: internal

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

3. Caddy version:

v2

4. How I installed and ran Caddy:

using helm chart

a. System environment:

docker

b. Command:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

c. Service/unit/compose file:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

d. My complete Caddy config:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

5. Links to relevant resources:

There’s an example at the bottom of reverse_proxy (Caddyfile directive) — Caddy Documentation that explains how X-Accel-Redirect would be done. Use handle_response to intercept the proxy response and do additional handling.

2 Likes

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