Hi, recently I asked someone how they made a normal domain name point to another with port. They directed me here: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html Where I found this: # For sites running on a port other than 80 RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteCond %{SERVER_PORT} !^80$ RewriteRule ^/(.*) http://www.example.com:%{SERVER_PORT}/$1 [L,R] How do I use this? Thanks in advance!
Using example domain names/ports, what exactly are you trying to accomplish? Eg. make https://cp.domain.com/ function as the ispconfig control panel, which is actually running on port 8080 (so the url looks nicer, without just redirecting to the port 8080 url)?
Thanks for answering jesse, yes that is what I want to accomplish to make it prettier. Once you enter the "normal" domain the ugly one with the port can still come up, just that it is easier to type and remember for my clients and me of course.
There is no manual configuration in the apache config files required. Just add a subdomain "cp" to the website domain.tld and put the target URL e.g. https://domain.tld:8080 in the redirect field of this subdomain.
That redirect does work function-wise; if you want to keep the nicer https://cp.domain.tld/ url displaying then instead of redirecting you would proxy the connection on the back end. There's a more comprehensive example at https://www.howtoforge.com/community/threads/3-1-update-reverse-proxypass-apache.73210/#post-344465, but the parts you'd need for just the 'cp' subdomain are this (using debian jessie file locations/commands): Enable proxy module and create a server-wide apache .conf file: Code: # cat >/etc/apache2/conf-available/proxy_requests_off.conf <<EOF <IfModule mod_proxy.c> ProxyRequests Off </IfModule> EOF # a2enmod proxy # a2enmod proxy_http # a2enconf proxy_requests_off And put this in the apache directives for the cp.domain.tld website: Code: <If "%{HTTPS} == 'on'"> SSLProxyEngine on <IfModule mod_proxy.c> ProxyRequests Off ProxyPreserveHost On ProxyPass /webmail "!" ProxyPass /roundcube "!" ProxyPass /squirrelmail "!" ProxyPass /phpmyadmin "!" ProxyPass / https://127.0.0.1:8080/ ProxyPassReverse / https://127.0.0.1:8080/ </IfModule> </IfModule> Note the above is untested (the example in that other post I linked above is tested code). That should also let you easily use a letsencrypt certificate for cp.domain.tld by enabling the checkbox for it. I've been planning to write somthing along those lines into a little howto here on howtoforge, as it's a nice solution for resellers to access a shared control panel through their own domain name, though I don't have an equivalent nginx example to go with it.
Thank you! @till Wouldn't it be nice to pick a FQDN in the ispconfig 3.1 install script that then would serve as the panel domain with automatic letsencrypt installation? Because giving my clients a schooling in how to access "unsafe" websites in their browser is shurely not to their liking