2

I am running CentOS 5.5 with the stock Apache httpd-2.2.3.

I want to set up a proxy server which will forward proxy requests from a single IP address (123.123.123.123 in the example below) and reject requests from all other addresses.

The problem is that apache is proxying all requests through port 81 (rather than just those from 123.123.123.123 and denying all other traffic).

My configuration file is as follows:

Listen 81
<VirtualHost *:81>
  ServerName my.server.com
  ProxyRequests On
  ProxyVia On
  <Proxy *:81>
    Order Deny,Allow
    Deny from all
    Allow from 123.123.123.123
  </Proxy>
  ErrorLog /var/log/httpd/proxy-error.log
  TransferLog /var/log/httpd/proxy-transfer.log
  LogLevel debug
</VirtualHost>

This is the only configuration file with any reference to port 81. No forward proxying is allowed for traffic on port 80 (it serves a website). I am definitely not at IP address 123.123.123.123 when making these requests via curl/Firefox proxy to test.

Commenting out the "Allow from 123.123.123.123" makes no difference - at this point it should simply deny all traffic to port 81.

Can anyone tell me how to fix the above configuration file to provide the requested behavior?

2

The match string for the <Proxy> block is for the resource being requested, not the server's listener.

Try <Proxy *> instead of <Proxy *:81>.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.