將 IP 存取做 redirect 到 domain
- 新增 /etc/sw-cp-server/conf.d/z-plesk.inc
touch /etc/sw-cp-server/conf.d/z-plesk.inc
- 加入重新導向指示
if ($host ~ '203.0.113.2'){
rewrite ^/(.*)$ https://hostname.com:8443/$1 permanent;
}
- 重啟 Plesk 服務
service sw-cp-server restart && service sw-engine restart
- 設定 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 存取。