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.
Note: The selected domain must not be hosted in Plesk, or have its hosting set to No web hosting
-
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
2 comments
Do I understand correctly that: if I select the second option, I'm still able to login via the main hostname. Correct?
So, if I want to use for example plesk.mycompanyurl.com to login I can just fill in the url and it works? Given that I have a dns a record to point the traffic to the server url.
How do I install ssl/tls certificates for this domain and is the http traffic forced to https?
I think these 3 help articles should be linked together as it appears you need all 3 steps to make it work, yes ? after changing the host name and setting custom url, to then go and issue a new certificate
1) https://support.plesk.com/hc/en-us/articles/12377745012247-How-to-customize-Plesk-URL
2) https://support.plesk.com/hc/en-us/articles/12377750836375--How-to-change-or-get-the-server-hostname-on-Plesk-server
3) https://support.plesk.com/hc/en-us/articles/12377713798039-How-to-secure-a-Plesk-hostname-on-port-8443-with-an-SSL-certificate-Let-s-Encrypt-other-certificate-authorities
Please sign in to leave a comment.