Hosting Apache behind Nginx Reserve Proxy – issues with subdomains

Hi

So I have a hypervisor which is running Nginx reverse proxy, and a whole bunch of VMs.

This works perfectly fine for all the guests, but I am having issues with the Apache guest.

Basically, I have 2 domains. The main domain goes to a different server altogether, and the subdomains (unless otherwise specified) goes to my public IP and ultimately the Hypervisor; that then routes the traffic depending on the subdomain.

Now, the second domain is pointed the same way, ultimately to be handled by the reverse proxy.
The reverse proxy either directs traffic to the correct guest, or it goes to the default “catch all” Apache guest.

This works as intended.

However, the issue lies with directing traffic within Apache guest.

The default works fine, but subdomains don’t. They all load the landing page I’ve set up.
When I change the doc root within the default vhost, the pages load, but for everything.

If I disable the default, only “the first” vhost works. It just doesn’t seem to like subdomains. Appending the URL with the doc root does.

I’m not sure what I’ve missed, or even if it’s possible considering the setup.



View Reddit by Quin452View Source

our recommended web hosting companies

NameCheap

website link: namecheap.pxf.io/Alaaeldin.medium

Hostinger

website link: https://hostinger.sjv.io/Jr95Qr

InMotion hosting

website link: partners.inmotionhosting.com/XxJ0Jg

Hubspot

website link: hubspot.sjv.io/DV2O35

Leave a Comment

Your email address will not be published. Required fields are marked *