I am looking for a solution to provide a webapplication running on our local network under a subdomain via SSL. We dont want to use a DynDNS but a subdomain of our own domain.
Our current setup
Root Server (internet)
We have a root server with ubuntu 16.04, apache 2, hosted at a data center where our domain example.com and all subdomains terminate.
<VirtualHost *:443>
ServerName SUB.EXAMPLE.COM
SSLEngine on
SSLProxyEngine on
SSLProxyCheckPeerCN On
SSLProxyCheckPeerExpire On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / https://PUBLICIP:9443/
ProxyPassReverse / https://PUBLICIP:9443/
</VirtualHost>
Application Server (local)
Debian with apache 2
<VirtualHost *:9443>
ServerName SUB.EXAMPLE.COM
ServerAdmin webmaster@localhost
DocumentRoot /var/www/MYAPP
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
</IfModule>
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/SUB.DOMAIN.COM/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/SUB.DOMAIN.COM/privkey.pem
</VirtualHost>
Research so far
- I know that the configuration on the root server is wrong, because I do not provide a certificate there, see Questions.
- Most solutions I've found yet are about SSL Handling from the reverse proxy (our root server), but the connection between both servers is not via ssl (e.g. because they are in the same network, so it not neccessary). Though we need it, because otherwise the communication between root server and application would not be encrypted.
- The firewall allows access on Port 9443, so when trying to access https://PUBLICIP:9443 I get NET::ERR_CERT_COMMON_NAME_INVALID (which is correct, because the cert is for SUB.EXAMPLE.COM).
Questions
Do I have to get 2 certificates? One for SUB.EXAMPLE.COM on our root server and one for our PUBLICIP (which is afaik not possible via Letsencrypt). Or is there any other way to fix that (without setting up a DNS)?