Hello everyone,
I’m encountering an issue with my server configuration after setting up a reverse proxy using OpenLiteSpeed. Here’s what I’ve done so far:
- I configured a reverse proxy to redirect a service (like phpMyAdmin) running on a specific port (for example, 11001) to a subdomain via rewrite rules.
- Example:
http://Server_IP:11001
is redirected tohttps://mysub.domain.tld
.
- The reverse proxy is working as expected, and I can access the service via the subdomain (
https://mysub.domain.tld
).
However, despite this setup, the port is still directly accessible via the public IP (http://Server_IP:11001
), which I want to block.
What I’ve Tried:
- I tried adding iptables rules to limit access to port 11001 to
localhost
only, but it didn’t work as expected. - I also explored CSF (ConfigServer Security & Firewall) options, but I still can’t block direct access via the IP.
My Goal:
I want the 11001 port to be inaccessible from the public IP and accessible only through the subdomain (via the reverse proxy that is already set up).
Do you have any suggestions on how I can configure OpenLiteSpeed or firewall rules to solve this issue?
Thanks in advance for your help!