I've setup a url shortner on ubuntu nginx at example.com. This will be for internal use only and don't want someone going to example.com to know a site exists there.
So going to example.com should show the same thing server not found like if you went to fdfjjkdsjfkhdsjkfdsf.com. But I do want example.com/admin to load. Is there anyway to do this? If /admin was subdomain vs a subdirectory I know how to. But not sure since its not. I can of course have the browser show one of many errors or blank page, for example.com but can't determine how to have it show as if the domain wasnt point to the server but still allow admin to work.
Or perhaps a workaround such as pointing admin.example.com to point to nginx virtual host where the root is /var/www/html/admin and example.com itself wouldn't put to the server. But then I assume the actual link shortner being generated via third party apps wouldn't work. This all may not be possible and beyond the scope of this github issues section but wasn't having luck on Stackover so thought I'd try here.
@ChrisChiera This is already more or less the default behavior.
Just catch the 404 return by php-fpm with nginx and turn it into a 444.
Anyway this question is more nginx related than YOURLS itself, so we won't be able to help you furthermore.
If you want the domain to be usable for short links, it must resolve. Period. DNS resolution doesn't have any way of knowing what path the user is trying to access; it's just a hostname-to-IP lookup.
The very short answer is, you can't do this. It's not technically possible. Showing a server error page is about the closest you can get.
Edit: Leo beat me to responding, but yes. Still not technically doable.
Leo beat me to responding
@dgw 馃殼 馃槤
@LeoColomb In my defense, I'm on my smartphone 馃槤
Thanks guys!
Most helpful comment
@LeoColomb In my defense, I'm on my smartphone 馃槤