Setup a Reverse Proxy with Nginx and Apache on EC2

Posted by heavymark on Server Fault See other posts from Server Fault or by heavymark
Published on 2011-01-08T19:27:58Z Indexed on 2011/01/08 19:55 UTC
Read the original article Hit count: 261

Filed under:
|
|
|
|

Good Day,

I am currently using the free Amazon EC2 micro instance to learn Linux and server setup.

I wish to setup Nginx as a reverse web proxy. I found a great article on mediatemple on how to do it: http://wiki.mediatemple.net/w/Using_Nginx_as_a_Reverse_Web_Proxy

The directions work for most any server except for EC2.One difference between EC2 and MediaTemple is how IPs work. Overall EC2 instances do not know their elastic IP. So when following the wiki directions in the virtual hosts for instance instead of myip:80 for instance I put *:80. When just using Apache this works perfectly.

In the apache virtual hosts I did "127.0.0.1:80" and in the Nginx I put *:80.

Apache restarts, by Nginx provides an error that it cannot bind because the ip is already in use. If I could add an actual IP in the Nginx file it would work but since EC2 requires me to put in the asterisk it ends up conflicting with the apache virtual hosts entry.

Anyone know a simple way around this (other than not using EC2) ;-) Thank you!

Cheers, Christopher

© Server Fault or respective owner

Related posts about apache

Related posts about apache2