Site doesn't load without trailing slash + lots of 421 errors

Hi @plumbe0,

This is a doozy to wrap my head around, but I’ve used Transmission in the past (I’ve been using Cloud-Torrent nowadays).

I believe that Transmission is issuing relative links, and this is a problem with how those are universally handled. Because /transmission is seen as a file beneath /, and /transmission/ is seen as its own directory, we see the following behaviour for the example relative link, ./foo/bar:

URL Result
example.com/transmission example.com/foo/bar
example.com/transmission/ example.com/transmission/foo/bar

Now, while I’m having all sorts of trouble getting RPC working on a different subfolder, I did manage to get the page and all its assets loading properly with the following Caddyfile:

test.whitestrake.net/transmission {
  redir {
    if {uri} is /transmission
    / /transmission/
  }
  proxy / transmission:9091/transmission/web/
  log stdout
  errors stdout
  gzip
}

https://test.whitestrake.net/transmission is a live website as of writing this post, so you can browse to it and check for yourself to see if it’s working as expected (as I mentioned, RPC is not working, so all you get is the actual page itself).

My final thoughts is that if I were you, I would try to put Transmission on its own subdomain and give it the root URI to save myself some headache.


P.S: Avoid using someone else’s registered domain name, such as redacted.com, when hiding your domain name in a publicly posted Caddyfile. The website http://example.com/ is reserved for this purpose, so use that instead. The entire .example TLD is also reserved in this way.

1 Like