Funny enough I already made a few changes to the traefik configs, I saw someone else’s post and if it’s safe to assume that any request with Accept header starting with application/ should be routed to the Lemmy server, the following would work as well:
- traefik.http.routers.leddit-api.rule=Host(`leddit.social`) && (PathPrefix(`/api`, `/pictrs`, `/feeds`, `/nodeinfo`, `/.well-known`) || Method(`POST`) || HeadersRegexp(`Accept`, `^[Aa]pplication/.+`))
I’ve also added caching policies to make sure none of the API responses are cached and having the UI be cached explicitly since it’s not done today.
services:
lemmy-server:
deploy:
labels:
- traefik.http.routers.leddit-api.middlewares=no-cache
- traefik.http.middlewares.no-cache.headers.customresponseheaders.Cache-Control=no-store
...
lemmy-ui:
deploy:
labels:
- traefik.http.routers.leddit-web.middlewares=cache-control
- traefik.http.middlewares.cache-control.headers.customresponseheaders.Cache-Control=public, max-age=86400
I use a combination of netbox for the physical/logical network and server connectivity, and outline for text documentation of the different components.