Determine the original address of the current web page. If it is IP 139.., the page will be displayed, otherwise it will not be displayed or will be redirected.
If it is convenient, put the root path of the server's default website into the root path of the website, so that the domain name and IP are equivalent. Then go to the configuration file of the domain name to set these paths to prohibit access.
If it is inconvenient, set these paths in the domain name configuration file to only allow local access. Then go to the configuration file of the default website and set these paths as reverse proxy to the path corresponding to the domain name.
Determine the original address of the current web page. If it is IP 139.., the page will be displayed, otherwise it will not be displayed or will be redirected.
The request header in the HTTP protocol will contain a HOST parameter. Just make a judgment based on this parameter.
If it is convenient, put the root path of the server's default website into the root path of the website, so that the domain name and IP are equivalent. Then go to the configuration file of the domain name to set these paths to prohibit access.
If it is inconvenient, set these paths in the domain name configuration file to only allow local access. Then go to the configuration file of the default website and set these paths as reverse proxy to the path corresponding to the domain name.
It’s better if you don’t need a domain name
Just don’t provide the domain name