Error 403 with second domain

Hi, I have a two Virtual hosts configured in Apache. They only differs in domain name and SSL cert, key. SSL certs are Cloudflare’s Origin SSL. Both domains are proxied on the same Cloudflare account.
The problem is test1.com domain works and test2.com domain doesn’t work (displays Error 403 forbidden). Logs show that Apache doesn’t even use the test2.com Virtual
Host configuration. I have checked tha turning the SSL off on test2.com and switching port 443 to 80 resolves the problem (test2.com starts to work).
Based on this I think the problem is Caused by the Origin SSL.

test1.com:

<VirtualHost *:443>

    ServerName test1.com
    ServerAlias www.test1.com
    DocumentRoot /mnt/SSD/www/test.com.pl
   SSLEngine on
   SSLCertificateFile /etc/ssl/certs/test1.com/test1.com.cert
   SSLCertificateKeyFile /etc/ssl/certs/test1.com/test1.com.key
   
<Directory /mnt/SSD/www/test.com/ >

        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>

</VirtualHost>

test2.com

<VirtualHost *:443>

    ServerName test2.com
    ServerAlias www.test2.com
    DocumentRoot /mnt/SSD/www/test.com.pl
   SSLEngine on
   SSLCertificateFile /etc/ssl/certs/test2.com/test2.com.cert
   SSLCertificateKeyFile /etc/ssl/certs/test2.com/test2.com.key
   
<Directory /mnt/SSD/www/test.com/ >

        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
		
    </Directory>

</VirtualHost>

Apache logs:

[Wed Sep 01 18:55:14.691179 2021] [authz_core:debug] [pid 2676:tid 140213074511616] mod_authz_core.c(846): [client 141.101.76.69:64552] AH01628: authorization result: granted (no directives)
[Wed Sep 01 18:55:14.691230 2021] [core:info] [pid 2676:tid 140213074511616] [client 141.101.76.69:64552] AH00128: File does not exist: /etc/httpd/htdocs/
[Wed Sep 01 18:55:14.836528 2021] [authz_core:debug] [pid 2676:tid 140213197870848] mod_authz_core.c(846): [client 141.101.77.249:11818] AH01628: authorization result: granted (no directives), referer: https://www.test2.com/
[Wed Sep 01 18:55:14.836577 2021] [core:info] [pid 2676:tid 140213197870848] [client 141.101.77.249:11818] AH00128: File does not exist: /etc/httpd/htdocs/favicon.ico, referer: https://www.test2.com/

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.