Score:0

Apache proxy server to another one

as flag

I have to servers apache, 1st is in my dmz (192.168.0.206), 2d one in my vlan (192.168.0.63).

On the first one, there is an apache server configured like :

# ---------------------------------------------
<VirtualHost *:80>
        ServerName mywebsite.myserver.net
        ProxyRequests Off
        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>

        ProxyPass / http://192.168.0.63:80/
        ProxyPassReverse / http://192.168.0.63:80/
        <Location />
                Order allow,deny
                Allow from all
        </Location>
</VirtualHost>

On the 2de one:

<VirtualHost 192.168.0.63:80>
        ServerName mywebsite.myserver.net
        RewriteEngine on
        RewriteRule ^/(.*) https://mywebsite.myserver.net/$1
</VirtualHost>

# SSL

<IfModule mod_ssl.c>
        <VirtualHost 192.168.0.63:443>

                ServerName mywebsite.myserver.net
                DocumentRoot /var/www/html/mywebsite/

                ErrorLog /var/log/apache2/mywebsite.myserver.net/error.log
                CustomLog /var/log/apache2/mywebsite.myserver.net/access.log combined

                SSLEngine on

                SSLCertificateFile /etc/ssl/certs/apache/mywebsite.myserver.net/cert.pem
                SSLCertificateKeyFile /etc/ssl/certs/apache/mywebsite.myserver.net/privkey.pem
                SSLCertificateChainFile /etc/ssl/certs/apache/mywebsite.myserver.net/fullchain.pem
        </VirtualHost>
</IfModule>

mywebsite.myserver.net has a public IP which is the public IP of a firewall. This one has a FORWARD rule to the 1st apache

-A FORWARD -d 192.168.0.206/32 -i eth0 -p tcp -m multiport --dports 80,443 -j ACCEPT

This rules works if I modify 1st apache conf to local virtual host.

But it doesn't work if I use:

ProxyPass / http://192.168.0.63:80/
ProxyPassReverse / http://192.168.0.63:80/ 

80 and 443 are accepted between 0.206 and 0.63. (telnet 192.168.0.63 80 from .206 works)

Did I miss something ?

ezra-s avatar
ru flag
Please do not use "Order, Deny, Allow" directives, also port 80 does not need to be specified when you do http:// because that's the default port. Also , can you clarify what do you mean by "doesn't work"? It is too vague.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.