How do I set up a reverse proxy with apache 2.4
-
I’ve found a few articles describing how to setup a reverse proxy with nginx, but I haven’t found one (or one i understand enough) describing how to do it with apache 2.4 Here’s what I’ve come up with so far:
domain = mydomainname.com
internal ip address of WP installation = 192.168.99.200
internal ip address of apache installation = 192.168.99.100apache – httpd-vhosts.conf
<VirtualHost *:80>
RequestHeader set X-Forwarded-Proto “http”
ServerName 192.168.99.200
ProxyPreserveHost On
ProxyPass /wordpress https://192.168.99.200/wordpress
ProxyPassReverse /wordpress https://192.168.99.200/wordpress
</VirtualHost>
and per this https://www.ads-software.com/support/topic/wordpress-behind-reverse-proxy-1, i added the following to the wp-config.php
$_SERVER[‘HTTP_HOST’] = $_SERVER[‘HTTP_X_FORWARDED_HOST’];
define(‘WP_HOME’, ‘https://mydomainname.com/wordpress’);
define(‘WP_SITEURL’, ‘https://mydomainname.com/wordpress’);$_SERVER[‘REQUEST_URI’] = str_replace(“192.168.99.200”, “mydomainname.com”, $_SERVER[‘REQUEST_URI’]);
I’m sure I’ve mangled some of the suggestions from the various articles I’ve seen, but I’ve somehow at least gotten to the point where I can login to the admin console. The rest of the pages seem to be dysfunctional.
- The topic ‘How do I set up a reverse proxy with apache 2.4’ is closed to new replies.