A few web apps I’m running seem to require being called with a trailing slash.
examples: NZBHydra, Organizr, Monitorr
If I go to this, all good (note the trailing slash):
https://my.domain.rocks:1234/monitorr/
but if I go to:
https://my.domain.rocks:1234/monitorr
… I can get anything from an all white screen, to a page where the text and links load, but the resources (images, CSS) don’t load.
So, I’m working an a Caddy rewrite directive to auto-add the trailing slash if it’s not there already …
My code so far looks like this:
regexp ^(\/nzbhydra(doc)?|\/monitorr(doc)?|\/organizr(v2doc)?)$
to {1}/
You can see it a bit better here: https://regex101.com/r/wYYqDu/1
This in theory should find for example, /nzbhydradoc , and rewrite it to /nzbhydradoc/
NOTE: I’m in the process of containerizing all of these apps, so I have a normal version and a “doc” version; both respective versions already have their reverse proxy added in Caddy and working).
According to the RegEx tester, this should be working …
In actual use however:
- nzbhydra: both the regular and doc versions do get the last slash appended.
- monitorr: the regular version gets it appended; the doc version does not.
- organizer: neither the normal version, nor the v2doc version gets the trailing slash appended
Any ideas anyone?
P.S. This forum is removing the delimiters in my code, but you cn see them in the RegEx tester I linked.