Accessing page using the IP:PORT of the server and preventing redirection to domain.tld/subfolder when accessed by IP

That’s not possible. The browser needs the domain name to actually perform the TLS handshake (the domain is important for establishing trust). And it’s not possible to ask the browser to obfuscate anything.

Why not use another domain like testing.sauru.sh and add a subdomain to that for each thing you’re testing? So like testapp.testing.sauru.sh. That way you don’t need to worry about subpath stuff (see The "subfolder problem", OR, "why can't I reverse proxy my app into a subfolder?", it can be a problem sometimes) and if the stuff you don’t care for them to see is on other subdomains, they won’t know to look for it.

You could also serve a site on a different port, but you’ll still need to use a domain name if you want TLS/HTTPS.

1 Like