Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
-
How to customize Plesk URL?
-
How to make Plesk interface accessible over a hostname without entering the port number? For example, https://server.example.com.
Answer
Note: If an existing in Plesk domain is going to be used as an entry point to Plesk, make sure that the option Permanent SEO-safe 301 redirect from HTTP to HTTPS is enabled at Domains > example.com > Hosting Settings and a valid SSL certificate is used. For more information, see this KB article.
-
Go to Tools & Settings > Customize Plesk URL.
-
Specify the domain that will be used as an entry point to Plesk.
-
Save the changes.
-
Connect to the Plesk server via SSH (Linux) / RDP (Windows Server).
-
Use these commands (on Windows Server, use a command prompt as an Administrator):
-
In this case, if there is a website with the specified name, it will become inaccessible because Plesk panel will be shown.
# plesk bin admin --enable-access-domain "server.example.com"
-
In this case, the panel will be accessible on any domain hosted on Plesk and not having website and via IP address on HTTPS.
# plesk bin admin --enable-access-domain ""
-
In this case, the feature will be disabled. Plesk will be accessible via default port 8443 only.
# plesk bin admin --disable-access-domain
-
Notes: If Plesk is used under WHMCS and configuration described below is applied, then login from WHMCS to Plesk will not work.
Warning: Fail2ban will be unable to prevent brute-force attempts because an IP address of a client will be 127.0.0.1, which is white-listed by default in Fail2ban configuration.
-
Enable nginx as a reverse-proxy web-server.
-
In Plesk, create a subscription with desired domain name (usually, the hostname). This domain should be resolved from the Internet. In this example, 'server.example.com' is used.
-
Enable the option Permanent SEO-safe 301 redirect from HTTP to HTTPS at Domains > server.example.com > Hosting Settings:
-
Un-check PHP support at Domains > server.example.com > PHP Settings and apply the changes.
-
Go to Domains > server.example.com > Apache & nginx setting > scroll down to the Additional nginx directives field and add the following lines:
Note: The
proxy_pass
directive should contain an IP address of the domain.CONFIG_TEXT: location ~ ^/(?!.well-known).*$ {
proxy_pass https://203.0.113.2:8443;
port_in_redirect off;
proxy_set_header Host $host;
client_max_body_size 2048m;
}
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k; -
Apply the changes.
Comments
1 comment
Hi!
This didn't work for me, the default domain appears instead of Plesk login. The custom domain is not physically on the server, only the IP address on the server.
Could this be due to the fact that the additional domain is being proxied by cloudflare?
Please sign in to leave a comment.