Hi all I'm new to ISPconfig and have searched the forum (and the web) for some time but can't find a solution. I'm trying to redirect all direct requests to the IP of my ISPconfig server to an SSL protected domain. It works with a normal rewrite rule or htaccess for the Apache default page, but I can't get it to work for the ISPconfig admin interface on port 8080. Can anyone point me in the right direction how to redirect a request to ISPCONFIG_IP:8080 to SSL_DOMAIN:8080? Thanks in advance
There is no specific ISPConfig IP, ISPConfig listens on port 8080 on the server, so it listens on all IP addresses and domains of that server. If you want to redirect traffic of the ISPConfig vhost to a different domain, then you must edit the ispconfig vhost file (you can find it in the usual place of the OS you use, theapache or nginx sites-available folder) and add redirect rules there. To make r changes update safe, you must also modify the ispconfig vhost template which you find in the folder install/tpl/ of the ISPConfig tar.gz file and copy it to /usr/local/ispconfig/server/conf-custom/install/
I think you could create a vhost with that ip and port that redirects to that domain and port. We normally catch all (any domain or ip with no vhost) to one domain as it is easier that way.
That update safety thing was one of the main concerns. Thanks for the hint with the tpl file. I just want to eliminate the use of the non-SSL IP completely and redirect all request to the IP at port 8080 to a "management" domain with SSL or, in case of the system-wide Apache default page to the main domain. I'm used to a similar option as a normal setting in Plesk but I don't mind doing it by hand. Gonna have a look at the ispconfig vhost file. Thanks for the fast reply.
ISPConfig redirects all http traffic on port 8080 to https out of the box, no matter if you connect to the IP or to a domain. If this is to the case on your system, then you might be using an older version.
You can see this in the ISPConfig Apache vhost, the line is: Code: # Redirect http to https ErrorDocument 400 "<script>document.location.href='https://'+location.hostname+':'+location.port;</script><h1>Error 400 - trying to redirect</h1>" Redirecting a custom port like 8080 from http to https is a bit tricky as you can't use the normal redirect mechanism in that case, but the above should work fine on Apache systems.