0

I have a problem that when I use an SSL reverse proxy from site1 to site2, it works quite well except for the peculiar fact that all images are of the incorrect height. Everything else seems to be in order, only image height is affected.

Here's how my ReverseProxy is set up:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName site2.com
    ServerAlias www.site2.com

    SSLProxyEngine On
    ProxyRequests Off

    ServerAdmin admin@admin.com
    ProxyPass "/"  "https://site1.com/"
    ProxyPassReverse "/"  "https://site1.com/"

    ServerAdmin ADMIN@ADMIN.com
    DocumentRoot /var/www/site2.com

    ProxyHTMLEnable On
    ProxyHTMLURLMap https://site1.com/ /

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/DOMAIN/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/DOMAIN/privkey.pem
</VirtualHost>
</IfModule>

Please help me out, I'm at a loss here and have no idea what could be causing this. This is running Apache2 on an otherwise stock Debian 10 system.

The CMS I'm using is wordpress.

EDIT: It seems like the source code on Site2 is messed up and therefore not identical to Site1. What can be done to make sure the proxied version is completely identical to Site1?

  • 1
    The apache configuration likely isn't helpful. Look at the browsers developer console and see if it fails to load any resources. Maybe there are some absolute links which now fail to load, maybe HTTP links which fail because of mixed content when accessed from inside HTTPS. Such problems need to be fixed in the site content and not in the server configuration. – Steffen Ullrich Dec 05 '21 at 10:43
  • Thanks for the suggestion, Steffen. But Site1 and Site2 shows the same console errors, although Site1 is working fine and Site2 is not. Also, Site2 requests resources directly from Site1 (Even though I have Site2 in the address bar, it requests css and other files directly from Site1). – RottenBoot Dec 05 '21 at 10:55
  • @RottenBoot There's not enough information here to diagnose this issue. Either you have to provide us access to the sites in question or include all relevant differences. – vidarlo Dec 05 '21 at 11:45
  • Your issue here is that you try to make wordpress behave under two different URL's. Wordpress is not built for that. It's not an apache problem or a proxy problem; it's a wordpress problem. The **proper** solution is probably a 301 redirect. Duplicate content will lead to a hit in seo ranking as well. – vidarlo Dec 05 '21 at 13:05

0 Answers0