Hello,
I'm using aaPanel on a VPS with Apache as my web server. My aaPanel is currently accessible through both the domain and the IP address. However, I want to block all direct access via the server's IP (including any port), so that the panel can only be accessed via my domain, which is routed through Cloudflare.
The domain configuration is working fine, and it points to the server using the following setup:
Domain: painel.saralapia.site
IP: 132.226.253.4
Port: 7800
Right now, when I try to access https://Vps_IP:7800, the aaPanel login page is displayed. I want to prevent access via IP and allow access only through the domain (https://painel.mydomain.com:7800).
I've tried configuring Apache with VirtualHosts to block IP access, but the login page is still accessible via the IP. Can anyone guide me on how to block all direct IP access and ensure the panel is only accessible through the domain?
Thank you in advance!