Forums

[resolved] WP Behind a proxy (3 posts)

  1. amooz
    Member
    Posted 2 years ago #

    Hello,

    I'm trying to run several websites for myself, one of them being wordpress, off of one IP. After Googling around a bit I found the mod_proxy for Apache which will let me do this. My endgame is to have something like this:
    |---> Server 1
    [internet]-->[proxy host]---+---> WordPress
    |---> Server 2
    |---> Server 3

    Each server is listening to ports 80 and 443. Here is what I have to proxy things to the WordPress server:

    NameVirtualHost *:80
    NameVirtualHost *:443
    
    <VirtualHost *:80>
            ServerName SERVER_URL
            ProxyPreserveHost On
            ProxyPass / http://1.2.3.4/
            ProxyPassReverse / http://1.2.3.4/
    </VirtualHost>
    
    #<VirtualHost *:443>
    #        ServerName SERVER_URL
    #        ProxyPreserveHost On
    #        ProxyPass / https://1.2.3.4
    #        ProxyPassReverse / https://1.2.3.4
    #</VirtualHost>

    The SSL-secured site has been disabled for now until I can figure out how to proxy the SSL propery (some help in this area wouldn't be unappreciated, but the main goal is I'd like to have a working site first.)

    Note: The configs above have been sanitized

  2. amooz
    Member
    Posted 2 years ago #

    Anyone? My website is down until this can be fixed..

  3. amooz
    Member
    Posted 2 years ago #

    I must apologize, I was digging through the logs on the WP server instead of my proxy server, I needed to add the following directive to actually allow the proxy:

    <Location />
    Order deny,allow
    Allow from all
    </Location>

    So my new config looks like this:

    NameVirtualHost *:80
    NameVirtualHost *:443
    
    <VirtualHost *:80>
            ServerName SERVER_URL
            ProxyPreserveHost On
            ProxyPass / http://1.2.3.4/
            ProxyPassReverse / http://1.2.3.4/
    <Location />
    Order deny,allow
    Allow from all
    </Location>
    </VirtualHost>

Topic Closed

This topic has been closed to new replies.

About this Topic