I have a server with the internal, shared IP of 123.123.123.123.
I have Virtualmin installed with Apache listening to port 8011 and 4431.
In Virtualmin, I created a Virtual Server for domain(dot)com, along with some of its sub domains Virtual Servers such as app1(dot)domain(dot)com, app2(dot)domain(dot)com, etc.
I have set up a reverse proxy with Nginx Proxy Manger, pointing app1(dot)domain(dot)com, app2(dot)domain(dot)com, etc. to 123.123.123.123:8011.
However, visiting app1(dot)domain(dot)com, app2(dot)domain(dot)com, domain(dot)com, etc. will only show the page at /var/www/html. I have checked the Website Options and confirmed that the home directory was in fact public_html, implying it’s in /home/domain/public_html.
There must be some misconfiguration somewhere that I am not aware of. What should I check to resolve this issue?
I just use Nginx Proxy Manager as the app to configure proxy. Isn’t it common to have reverse proxy configured with Apache?
My Nginx Proxy Manager is listening to port 80 and 443. I have Apache running, but it’s listening to 8011 and 4431. When a traffic request is through (say, app1.domain.com:80), NPM will route it to :8011 and :4431 accordingly.
I just don’t understand why Virtualmin only displays the homepage in /var/www/html/.
Apache works fine without Nginx. I’d say something is lost at that point. My first guess is the request doesn’t get through Nginx so the default page gets served. At this point I wouldn’t know which is serving up the page.
It’s probably a waste of time and resources to do so.
And, at the scale people are using Virtualmin, it’s almost always a mistake to do so.
I’d recommend you get everything working without a proxy, and then decide whether you need the added complexity of a proxy, and whether the proxy actually helps solve whatever problem you think the proxy is solving.
In short: For most people and deployments, if you want to use nginx, you should use nginx (and not Apache). Likewise, if you want to use Apache, you should use Apache (and not nginx). Both Apache and nginx are extremely capable web servers and proxies. Whatever task you’re trying to accomplish can be done with either one, and 99.9% of cases, there is no difference worth speaking of for end users (i.e. performance of nginx is better, but your apps are too slow to show any difference between Apache and nginx).