It's likely that I missed the answer already because I'm not even sure how to phrase this, but here it goes...
I'm attempting to create a healthcheck virtual--something "file", maybe, so whenever the address ends in something like .../check
it is served some .html file from a specific location at the server-level config file so it's matched regardless of virtual host or if whatever is in the patch before /check
-- in this example -- exists or not. e.g;
https://dns/non-existentPath/moreRandom/check → /var/www/html/someFile.html
http://dns/check → /var/www/html/someFile.html
http://dns/virtualHostThatExists/check → /var/www/html/someFile.html
I managed doing it for this pseudo-universal assets directory that is matched at any level so files used in things like error pages and other domain-wide resources are always in the same place, it uses the AliasMatch
directive:
AliasMatch "(.*)/specialDirExample/([^.].*)" "/var/www/html/someLocation/domainWide/assets/$2"
it works perfectly. But in the /check
case since I'm not trying to serve a directory but a file, as far as I know a rewrite rule, not AliasMatch
is what I need. I started reading the documentation I understand how to rewrite things but to a certain point only, I haven't been able to make up how the "any level" part comes in, if maybe one of the alias directives should be mixed in too. Right on the newbie docs redirection is mentioned too, making it a little harder to follow.
Could you give an example of how this would be done please? I could solve this very easily with a reverse proxy but this is for the proxy!