I’m running Nextcloud docker on UnRAID and I want to be able to share links with friends over the public web but disable the default login page and access my personal files only from within my LAN or remotely via VPN.
I know this can be done with multiple server and location blocks in the nginx site config but I can’t get it to work. Any tips?
Got it in one!! You need to configure something (reverse proxy/nginx/whatever) to only allow access to a URL with /s/ in it. Such as https://sub.domain.tld/s/PTHRfXzbTp7ATAg
All other URL requests need to be blocked.
How you do this is up to you. We can’t configure your system for you, but I would start by looking at how the official nginx configuration in the handbook handles this and go from there.
But I never said to disable the default location block
Personally I would leave everything as is on the main server and setup a reverse proxy that only serves content from /s/. Keep in mind this is well outside of the normal configuration and requires the knowledge to do so.