1

I am using apache2 server for a domain which has several subdomains. Each subdomain needs to be on https. I have a wildcard certificate installed for this and it works fine. Now one specific subdomain domain (api.mydomain.com) needs to proxypass to a upstream node service on https. How do I achieve this in the vhost config below:

<VirtualHost *:443>
DocumentRoot /var/www/html
ServerName mydomain.com

// Need to proxy pass one subdomain (https://api.mydomain.com) to a upstream service running at 8080


# wild card certiicate for mydomain.com:
SSLCertificateFile /etc/letsencrypt/live/mydomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

Is it possible to do this in same vhost or there is a workaround with a separate vhost for api.mydmain.com or yet another way to achieve this?

beNerd
  • 117
  • 5
  • 1
    Does this answer your question? [How can I use Apache as a reverse proxy for https?](https://serverfault.com/questions/964454/how-can-i-use-apache-as-a-reverse-proxy-for-https) – djdomi Apr 14 '22 at 03:44

0 Answers0