Please excuse me, I have little experience in setting up web servers, so I’m asking for help. There is server A and server B of an Apache web server, there is domain.com (server A) and sub.domain.com (Server B). There is a white IP that forwards to domain.com. How to make a config correctly to open a subdomain via https
On server A there is a config for forwarding the subdomain to server B
<VirtualHost *:80>
main domain config here
<VirtualHost *:80>
ServerName sub.domain.com
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/sub.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sub.domain.com/privkey.pem
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://sub.domain.com/
ProxyPassReverse / http://sub.domain.com/
Via http, the desired site is opened, via https, the site of the main domain is opened.
Ivan Dedov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.