• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Redirect Domain to Plesk Secure 8443

Hi NicolasP.,


Could you please tell us, WHERE you are stuck or/and which issues/errors/problems you experience, after you changed WHAT at WHICH configuration files?

Hello. I did the following:

I create a /etc/sw-cp-server/conf.d/zzz-myhost.inc file with the following content:

error_page 497 https://panel.provider.com:$server_port$request_uri;

Then I restart sw-cp-server

/etc/init.d/sw-cp-server restart

I also used "Custom Plesk Host Extension".

But when I try in browser "domain.com:8443", it doesn't redirect to "https://panel.provider.com:8843".
 
Hi NicolasP.,

pls. open the file "plesk.conf" ( => /etc/sw-cp-server/conf.d ) and have a look, if your additional "zzz-myhost.inc" is included with an "include" path. The actual Plesk Onyx sw-cp-server - configuration only includes
Code:
        include conf.d/*ipv6_ports.inc;
        include conf.d/*plesk.inc;
        include conf.d/*wpb.inc;
... by now.​

The basic includes at "config" ( => /etc/sw-cp-server ) only includes *.conf - files:
Code:
.....

    include /etc/sw-cp-server/conf.d/*.conf;
}
 
Hello.

I am trying to redirect domains when they add http://domain.com:8443 to https://panel.server.com:8443 using this article About Plesk URL or Telling Customers the Right Address to Go to - Plesk, but it doesn't redirect to server secure domain.

Server Information
Version: Plesk Onyx v17.5.3 Update #24
OS: Ubuntu 16.04.3 LTS

I made that same address as follows, on the domain name to redirect generate a .htaccess with the following syntax:
Code:
RedirectMatch 301 ^/$ https://panel.domain.com:8443

I do not know if this solution could also help
 
Hi garcue,

I do not know if this solution could also help
If the Plesk Control Panel would run as a apache - webserver = yes. But the "sw-cp-server" is an nginx - webserver, while we all know, that nginx can't read ".htaccess" - files. :(
 
Hi garcue,


If the Plesk Control Panel would run as a apache - webserver = yes. But the "sw-cp-server" is an nginx - webserver, while we all know, that nginx can't read ".htaccess" - files. :(

Hi UFHH01,
True, in that case you can try to get this into the domain.tld > Apache and nginx Settings > nginx Additional Policies.
Code:
location ~ ^ {
  rewrite ^(.*)$ / $ https://panel.domain.com:8443 redirect;
}

:)
 
Last edited:
Hi NicolasP.,

pls. open the file "plesk.conf" ( => /etc/sw-cp-server/conf.d ) and have a look, if your additional "zzz-myhost.inc" is included with an "include" path. The actual Plesk Onyx sw-cp-server - configuration only includes
Code:
        include conf.d/*ipv6_ports.inc;
        include conf.d/*plesk.inc;
        include conf.d/*wpb.inc;
... by now.​

The basic includes at "config" ( => /etc/sw-cp-server ) only includes *.conf - files:
Code:
.....

    include /etc/sw-cp-server/conf.d/*.conf;
}

Hi,
I made the following:

1) Rename zzz-myhost.inc to zzz-plesk.inc
/etc/init.d/sw-cp-server restart
(didn't work)

2) I added in plesk.conf "include conf.d/zzz-plesk.inc"
Restart but didn't work again

What am I doing wrong?

Thank you!
 
Hi UFHH01,
True, in that case you can try to get this into the domain.tld > Apache and nginx Settings > nginx Additional Policies.
Code:
location ~ ^ {
  rewrite ^(.*)$ / $ https://panel.domain.com:8443 redirect;
}

:)

Hi.

This will only work for one domain and you need to add this to all domains in your server.
 
Hi NicolasP.,

did you check you logs for any issues/errors/problems ( => /var/log/sw-cp-server ) ?

And did you consider to comment and add instead at "config" ( => /etc/sw-cp-server ) ( example !!! ) :
Code:
...

    #error_page 497 https://$hostname:$server_port$request_uri;
    error_page 497 https://panel.provider.com:$server_port$request_uri;
 
Hi NicolasP.,

did you check you logs for any issues/errors/problems ( => /var/log/sw-cp-server ) ?

And did you consider to comment and add instead at "config" ( => /etc/sw-cp-server ) ( example !!! ) :
Code:
...

    #error_page 497 https://$hostname:$server_port$request_uri;
    error_page 497 https://panel.provider.com:$server_port$request_uri;

I tried it inside config and it din't work and the error I get is
[error] 22280#0: *11 open() "/opt/psa/admin/htdocs/robots.txt" failed (2: No such file or directory), client: 88.105.*.*, server: , request: "GET /robots.txt HTTP/1.1", host: "server.pa*****.com:8443"
 
I tried it inside config and it din't work and the error I get is

I just fixed (temporary I think) by just changing the hostname to panel.provider.com.
And because, for some reason, HostEurope change the hostname to the default one "lvps.xxxxxx.xxxxx" on reboot,
I add this to /etc/rc.local
hostname panel.provider.com
/etc/init.d/sw-cp-server restart
 
Back
Top