• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Different behavior from domain aliases of same domain

Matt M

New Pleskian
This is a weird one. I have three domains, let's call them domain1.com, domain2.com and domain3.com.

Domain1.com is the main domain.
Domain2.com is a domain alias of domain1.com
Domain3.com is a domain alias of domain2.com

I am using the domains WITHOUT a 301 redirect. I don't want to get into too many details, but this is necessary in this case.

In my nginx settings for domain1.com, I have the following setting:

Code:
location /item {
    try_files $uri $uri/ /item.php?id=$uri;
}

The idea is that when someone accesses "https://www.domain1.com/item/whatever", the requested is routed internally to item.php.

If requesting:
This works correctly in all 3 cases.

The bizarre behavior starts when requesting an item that doesn't exist. The correct behavior is for the item.php script to receive the request and respond that the item does not exist. However, here is what happens:
WHAT?! Domain2.com and domain3.com were both created the exact same way, as domain aliases.

Things I have tried:
  1. Deleting domain2.com and domain3.com and adding them again as domain aliases. No change.
  2. `plesk repair web domain1.com` to rebuild the configuration. No change.
  3. Looked at the files in /var/www/vhosts/system/domain1.com/conf/ to see if domain2.com or domain3.com are treated differently in the settings. There is no difference.
  4. Restarted Apache and nginx. (Proxy mode is turned off for these domains, they should be using nginx only.) Still nothing.
I'm completely lost and confused as to this strange behavior. I'm not even sure where to start diagnosing it.
 
More digging:

(1) After deleting all of the config files under /var/www/vhosts/system/domain1.com/conf/ and rebuilding them with `plesk repair web domain1.com`, the server now returns the same output of File Not Found for https://www.domain3.com/item/existing-item AND https://www.domain3.com/item/non-existing-item. So the behavior is AT LEAST consistent now. I still don't have the first clue why domain2.com is working fine, but domain3.com is not.

(2) I manually edited the following files:
  • /data00/vhosts/system/russiandoska.ru/conf/httpd_ip_default.conf - this is the Apache config file and I told it to add the header "This is Apache" to all requests using `Header set MyHeader "This is Apache"`
  • /data00/vhosts/system/russiandoska.ru/conf/httpd_ip_default.conf - this is the nginx config file (as expected) and I told it to add the header "This is Nginx" using `add_header X-Powered-By "This is Nginx" always;`
Result:
So it looks like requests to domain3.com are being processed by Apache, not nginx. WHAT?!

I'm investigating further.
 
This is indeed odd at a first glance.

One thing I noticed:

Domain1.com is the main domain.
Domain2.com is a domain alias of domain1.com
Domain3.com is a domain alias of domain2.com

and I wonder if this change would make any difference:

Domain1.com is the main domain.
Domain2.com is a domain alias of domain1.com
Domain3.com is a domain alias of domain1.com
 
Back
Top