Subdomain to Directus

1. My Caddy version (caddy version):


2. How I run Caddy:

Not sure, but it works.

a. System environment:

Ubuntu 18.04. Caddy2 installed as a service. Docker pulls mysql + directus with docker-compose.

b. Command:

thou shalt confuse easily

c. Service/unit/compose file:

(sourced here)

d. My complete Caddyfile or JSON config: {

reverse_proxy to localhost:8080


3. The problem I’m having:

I don’t know if I should be asking here or with Directus folks, but here goes…

The reverse_proxy seems to work alright, it takes a few refreshes sometimes which I don’t understand but lets me look at my broken Directus. One time it even let me login only to see the graphic below.

I can also go to the server-ip:8080 and get a fully functional Directus, but is Caddy involved in that?

There will be follow-up questions:
I’d love to get this on a subdomain, but first attempts at using in the Caddyfile ( + caddy reload) returned nothing.

And if Directus requires PHP and I haven’t touched PHP, how is Directus working?

How does php_fastcgi work here?

4. Error messages and/or full log output:

Screenshot 2020-04-08 21.10.50

5. What I already tried:


6. Links to relevant resources:

  1. Caddy is working
  2. Directus on Docker
  3. Caddy on Directus (I’d love to help update this)
  4. docker-compose.yml

Thank you very much!

This tries to proxy to two different backends, load balancing between to and localhost:8080, so half your requests will be failing.

The correct syntax is:

reverse_proxy localhost:8080

The directus docker image seems to be an apache server with PHP included. It’s all in that one image. You’re just putting Caddy in front of it :+1:

1 Like

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