Question
How to make Plesk interface accessible over a hostname without entering the port number? For example, https://server.example.com.
Answer
Plesk Obsidian
All new Plesk Obsidian servers have this feature enabled by default, while on upgraded servers this feature should be enabled.
Note: If an existing in Plesk domain is going to be used as an entry point to Plesk, make sure that the Permanent SEO-safe 301 redirect from HTTP to HTTPS option is enabled at Domains > example.com > Hosting Settings and a valid SSL certificate is used. For details, check out 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.
-
Use the commands:
# plesk bin admin –enable-access-domain “server.example.com”
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 “”
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 –disable-access-domain
In this case, the feature will be disabled. Plesk will be accessible via default port 8443 only.
Plesk Onyx for Linux
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.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.