Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I configured an HTTP proxy server on my EC2 instance using Apache's mod_proxy module. I now want the proxy to accept requests only from my other EC2 instances, how do I achieve that?

This is my proxy config:

ProxyRequests On                                                                                                                                                                   

<Proxy *>                                                                                                                                                                          
 Order deny,allow                                                                                                                                                                  
 Deny from all                                                                                                                                                                     
 Allow from ???                                                                                                                                               

I know a solution could be to have to proxy to listen on another port, and configure a security group on AWS so that only my EC2 instances can access that port, is this the way to go?

Thank you.

share|improve this question

Well this is an interesting problem. If you don't have a VPC setup for your instances where you can control their internal LAN subnets, Amazon makes them pretty much random for you.

Now your security groups by default will let any of your own ec2 instances have full access to each other so just allow all from

Allow from 10

That is your best solution if you aren't using a VPC without the headache of adding new lines for each instance that spins up.

share|improve this answer
Thank you, @Mike. I tried and it doesn't work.. To be honest something VERY bizarre is happening, all the proxy rules are not applying. Even specifying only <Proxy *>Order Allow,Deny</Proxy>, I'm still able to use the proxy from my PC. I tried every possible configuration and I'm always able to use it from my PC, unless I specify ProxyRequests Off. Do you know what could be the reason? Thank you. – satoshi May 13 '12 at 23:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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