Php-form response headers

1. Caddy version (caddy version):


2. How I run Caddy:

Traefik proxy → Caddy → PHP-FPM

a. System environment:

Docker / Ubuntu

b. Command:

c. Service/unit/compose file:

d. My complete Caddyfile or JSON config:

root * {env.WEBROOT}
file_server {
	precompressed zstd br gzip
php_fastcgi app:9000

3. The problem I’m having:

Using Inertia it must pass x-inertia: true header but it’s not passed through Caddy. Just these:

resp_headers":{"Content-Type":["text/html; charset=UTF-8"],"Server":["Caddy"],"X-Powered-By":["PHP/8.0.6"]}

I found this, maybe I need to approve it?

4. Error messages and/or full log output:

5. What I already tried:

6. Links to relevant resources:

Turned out to be a line break in top of one the files, causing the headers to be sent too early. Damn.

Which version exactly? There’s been many v2 versions, and the exact version determines which features or bugs might exist. Please make sure to use the latest, v2.4.3.

I have to ask - do you really need Traefik in front of Caddy? You can completely replace Traefik with Caddy.

I happen to use Inertia with Caddy with a Laravel project, and it works perfectly. I’m almost certain the issue is with Traefik, which might not transparently proxy all headers. If your remove it from the pipeline, it should work just fine.

Oops, wrote the above before seeing this. What I wrote still stands though.

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