I've set up Nginx Proxy Manager on my server and configured a reverse proxy for my domain with SSL (Let's Encrypt). Everything works fine and i can access my web service through my domain securely via HTTPS, but I have a problem: Anyone can access my service via http://IP:PORT, which I want to completely block.
I want to restrict access to my server so that it can only be accessed through https://DOMAIN and not through the server's public IP address.
I've already tried the following things:
- Redirecting HTTP to HTTPS and restricting access to only the domain. -> not able to write the IP address into the domain field in NPM
- Using Custom Nginx Code to block direct IP access completely. -> then the Proxy Host gets the status 'offline'
- enable HSTS -> still allows access over IP
Has anyone faced a similar issue or can suggest the best way to configure this in Nginx Proxy Manager? I’d really appreciate any kind of help or suggestion.
Thanks in advance!