• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Azure Application Gateway - Hostname/Virtual Hosts not resolving

egoshake

New Pleskian
Server operating system version
CentOS7
Plesk version and microupdate number
Onyx 17.8
Hi,

Im using Azure infrastructure (Application Gateway, VNets and Virtual Machines) to create a mirror setup using CentOS7 Plesk Obsidian with a load balancer aka the Application Gateway for resilience.

Everything is configured properly, except Plesk is serving the default homepage files from /home/vhosts/default/htdocs on both instances, and I've been trying for 12 hours to understand why.

As I understand it, the VirtualHosts configuration serves the correct htdocs folder location, based on the headers in the request. I've ensured that the Azure infrastructure is passing all the original requests to Plesk, but the only way I have managed to get the correct site/domain to show is by manually editing the /etc/httpd/conf/plesk.conf.d/server.conf to manually use the correct folder location (e.g. /var/www/vhosts/mysite.org/htdocs) but this is problematic and not working properly when trying to serve includes from folders.

Please could someone shed some light on what possible problems could be causing this, and how exactly the request to Apache/nginx is passed to request the correct site?
 
If your question is about virtual hosts: Nginx is using name based virtual hosting. The correct subscription is selected by looking at the domain name for which the request is being sent to the server. The communication between Apache and Nginx is also name based, but internal only. When the default page is returned, probably the domain name cannot be read from the incoming request or it is not a name that is configured on the server.
 
Thanks for your reply, how would I adjust the names configured on the server or investigate the missing requests?
Also it is worth nothing that the address is a subdomain of our primary website, and it seems difficult to configure a subdomain in Plesk? It always shows a www. first when registering a new subscription.
 
Hi @egoshake.

I haven't touched on the application gateway that much yet but you would want to make sure you have a rule set up to forward the domain name as well within the request, this way the virtual domains is picked up. I can't remember if the Application Gateway is able to do such a thing but considering you can create rewrite conditions you should be able to do it.

Usually you won't use an application gateway for a Plesk instance since you're asking for trouble. You would usually have your main site configured for the routing then creating a rewrite rule to route, say, /images or /videos to a different pool of servers. You would usually just use a normal load balancer for that.

In either case, you'll want to make sure that the application gateway isn't scraping away the domain on the request, otherwise you'll get the default page because of how the web server is configured.
 
Back
Top