如何避免 IP 存取 Plesk login 頁面

將 IP 存取做 redirect 到 domain

  1. 新增 /etc/sw-cp-server/conf.d/z-plesk.inc
touch /etc/sw-cp-server/conf.d/z-plesk.inc
  1. 加入重新導向指示
if ($host ~ '203.0.113.2'){
rewrite ^/(.*)$ https://hostname.com:8443/$1 permanent;
}
  1. 重啟 Plesk 服務
service sw-cp-server restart && service sw-engine restart
  1. 設定 Customize Plesk URL

Tools & Settings > Customize Plesk URL

選擇 The specified domain or subdomain that resolves to the server IP address but is not used for hosting.

輸入特定的網域,這樣一來就不會被奇怪的 hostname 存取。

參考資料:https://support.plesk.com/hc/en-us/articles/12377482124439-How-to-configure-redirect-from-domain-name-IP-address-to-server-hostname-on-port-8443-in-Plesk-for-Linux