SOLVED webmail proxy seems not to work on only one domain : redirects to https://www.DOMAINE.TLD/___proxy_subdomain_webmail/ +bad layout

Operating System & Version
CentOS 7 + CloudLinux OS+
cPanel & WHM Version
v98.0.8

Markif

Well-Known Member
Nov 9, 2016
55
7
133
Toulouse
cPanel Access Level
Root Administrator
Hello,
we have a problem on 1 site on a server.
The other sites proxy good when asking webmail.DOMAIN.TLD
but one site it does not work, it rederects to https://www.DOMAINE.TLD/___proxy_subdomain_webmail/
and the layout is mixed up.
I verifyed the DNS as could not find problems, the settings seems the same...
I verifyed the http.conf file, and there also the config seems the same for the different domains.
There are no directives in /etc/apache2/conf.d/userdata/ssl/2_4/ that concern that domain.
Server runs v98.0.8 with cloudlinux OS+ and cage FS.
Has already be done with no succes :
# /usr/bin/selectorctl --apply-global-php-ini
# /usr/sbin/cagefsctl --apply-global-php-ini
# cagefsctl --force-update
# cagefsctl --rebuild-alt-php-ini
# /scripts/rebuildhttpdconf
# service httpd restart
Has someone a suggestion what can be the problem ?
Thanks for your help, Best regards,
Yves
 
Last edited by a moderator:

Markif

Well-Known Member
Nov 9, 2016
55
7
133
Toulouse
cPanel Access Level
Root Administrator
PS : looking at
I've put "Use X-Frame-Options and X-Content-Type-Options headers with cpsrvd [?]" to no
But tjos gives no change
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
Hey there! It sounds like you've already checked all the common issues that could cause this. Could you submit a ticket to our team so we can check this out directly on your server? Once you've done that, just post the ticket number here so I can follow along.
 

Markif

Well-Known Member
Nov 9, 2016
55
7
133
Toulouse
cPanel Access Level
Root Administrator
@cPRex

Hello,

Yes indeed, support did find the problem in the custom configuration.
There was inside an include file
/etc/apache2/conf.d/userdata/std/2_4/<UNIX>/<SITE>/<INCLUDE>.conf
a rewrite rule for adding "www" to the domain name,
Apache config:
<ElseIf "req('Host') != 'www.DOMAIN.TLD'">
    RedirectMatch 301 (.*) https://www.DOMAIN.TLD$1
</ElseIf>
Due to the order of processing of Apache directives, the custom configuration was imposing on cPanel's default service subdomain configuration that resides in the same virtualhost block.
This has been changed in
Apache config:
<ElseIf "! %{HTTP_HOST} in { 'www.DOMAIN.TLD', 'cpanel.DOMAIN.TLD', 'webmail.DOMAIN.TLD', 'webdisk.DOMAIN.TLD', 'autodiscover.DOMAIN.TLD', 'cpcalendars.DOMAIN.TLD', 'cpcontacts.DOMAIN.TLD'  }">
    RedirectMatch 301 (.*) https://www.DOMAIN.TLD$1
</ElseIf>
to avoid interference with the CPANEL proxy rules.

In fact it was even an old rule for an alias domain that is not even present anymore, but was still present in the custom includes :-(.
So the lesson is that a regular review of these custom Apache includes is useful to not let there old configuration includes !

Big thanks for the help to solve this !
Yves
 
  • Like
Reactions: cPRex