Hi everybody!
I'm configuring a new Plesk 17.8 server on CentOS 7 and need some assistance.
Let's say there is one hosted domain on the server, example2.com. The server has a FQDN hostname server.example.com and is secured with a Let's Encrypt certificate, set to be used for the Plesk interface. I can access Plesk without issues.
According to this article: How-to-redirect-from-the-domain-to-the-server-hostname-on-port-8443 adding this into /etc/sw-cp-server/conf.d/plesk.conf (within the server directive):
and than restarting the services:
should do the trick.
But it doesn't work for me! If I visit Plesk using https://example2.com:8443, there is no redirect, as if nothing has changed. I get a certificate warning, as expected, the certificate shown correctly belongs to server.example.com.
If I visit Plesk using https://server.example.com:8443, I get a redirect to https://server:8443 and a also certificate warning!
"hostname -f" returns "server.example.com", "hostname -a" returns "server". But shouldn't the $hostname variable in nginx contain the full hostname??
Can't really make out what's going on.
BTW, I also tried simply:
with the same result.
Any ideas?? Perhaps it's something trivial and I'm just not seeing it?
I'm configuring a new Plesk 17.8 server on CentOS 7 and need some assistance.
Let's say there is one hosted domain on the server, example2.com. The server has a FQDN hostname server.example.com and is secured with a Let's Encrypt certificate, set to be used for the Plesk interface. I can access Plesk without issues.
According to this article: How-to-redirect-from-the-domain-to-the-server-hostname-on-port-8443 adding this into /etc/sw-cp-server/conf.d/plesk.conf (within the server directive):
Code:
set $test "0";
if ( $host = '$hostname' ) {
set $test "1";
}
if ( $test = "0" ) {
rewrite ^/(.*)$ https://$hostname:8443/$1 permanent;
}
and than restarting the services:
Code:
systemctl restart sw-cp-server.service
systemctl restart sw-engine.service
should do the trick.
But it doesn't work for me! If I visit Plesk using https://example2.com:8443, there is no redirect, as if nothing has changed. I get a certificate warning, as expected, the certificate shown correctly belongs to server.example.com.
If I visit Plesk using https://server.example.com:8443, I get a redirect to https://server:8443 and a also certificate warning!
"hostname -f" returns "server.example.com", "hostname -a" returns "server". But shouldn't the $hostname variable in nginx contain the full hostname??
Can't really make out what's going on.
BTW, I also tried simply:
Code:
if ( $host != $hostname ) {
rewrite ^/(.*)$ https://$hostname:8443/$1 permanent;
}
with the same result.
Any ideas?? Perhaps it's something trivial and I'm just not seeing it?