0

I host different domains on different web servers using 1 external IP address.

To make this possible I use Apache as a kind of reverse proxy to forward exampleA.com to 192.168.2.1 and exampleB.com to 192.168.2.2 etc.

Let's say Wordpress is using exampleC.com and 192.168.2.3

Wordpress is doing just fine when I access it using http://ExampleC.com. when I try to access http://ExampleC.com/wp-admin I get a 403 forbidden error though.

the Vhost of the domain in the reverse proxy looks like this:

<VirtualHost *:80>
    ServerName exampleC.com
    ProxyRequests Off
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    ProxyErrorOverride On
    ProxyPass / http://192.168.2.3/
    ProxyPassReverse / http://192.168.2.3/
    <Location />
            Order allow,deny
            Allow from all
    </Location>
RewriteEngine on
RewriteCond %{SERVER_NAME} =exampleC.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

and:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName exampleC.com
    ProxyRequests Off
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    ProxyErrorOverride On
    ProxyPass / http://192.168.2.3/
    ProxyPassReverse / http://192.168.2.3/
    ProxyPreserveHost on
    <Location />
            Order allow,deny
            Allow from all
    </Location>
SSLCertificateFile /etc/letsencrypt/live/exampleC.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/exampleC.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

Anyone an idea what I am doing wrong?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.