apache pass domain through mod_proxy to validate with mod_access

Posted on

apache pass domain through mod_proxy to validate with mod_access – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about apache-2.2, , , , .

I have an apache proxy server that forwards requests to backend servers. The backend servers use mod_access to allow or deny access to specific directories. Before implementing a proxy server with backend web servers, the one web server used a syntax like:

order deny, allow
deny from all
allow from 10.10.4
allow from domain.com

but now, the ip and domain are always the proxy server. I know the X-Forwarded_For ip is set, but I don’t know how to add that into the mod_access configuration. And I don’t see the forwarded host at all. Is there any way to do this?

Solution :

This is untested but should work:

Backend config:

SetEnvIf X-Forwarded-For "^192.168.0." allowme
order allow,deny
allow from env=allowme
deny from all

This would allow from and block all others..

Leave a Reply

Your email address will not be published. Required fields are marked *