Media doesn't sync behind Caddy – Error 303 when downloading media, upload works fine

What follows below is just a list of things that I found – it might give you ideas or even help, but it also might be useless.

  1. Maybe something you can check: Does it work without caddy, using the server directly?
  2. Considering you’re having issues with downloading media, maybe there is a timeout that is set too short? Apparently the Caddyfile contains something like
handle {
  reverse_proxy http://ADDRESS:PORT {
    transport http {
      read_timeout 60s
      write_timeout 60s
    }
  }
}

So if yours contains something similar, maybe try to increase the timeouts?

  1. You’re getting read: connection reset by peer. Doesn’t that mean that your Anki server (so not caddy) closed the connection earlier than expected? Maybe you can adjust timeouts here as well? Or something like “keep-alive”?
  2. No idea what any of those things mean, but apparently header_up can be useful sometimes when it comes to media: reverse_proxy (Caddyfile directive) — Caddy Documentation.
  3. Just because it’s so similiar regarding the error: Maybe check the things Dae mentioned in Get HTTPError() code:303 when I try to sync (even though it’s not related to custom sync servers or caddy).