Can I use nginx to start EC2 instances on demand?

Posted by Gabe Hollombe on Server Fault See other posts from Server Fault or by Gabe Hollombe
Published on 2012-12-10T01:14:49Z Indexed on 2012/12/10 5:08 UTC
Read the original article Hit count: 461

Filed under:
|
|

TL;DR - Is there a way to make nginx act as an elastic load balancer that will spin up EC2 instances on demand, allowing for the case when periods of no demand mean no instances will be running?

Longer explanation - I have an nginx server that proxy_pass'es requests to a server on EC2. This server doesn't get many requests, so I'd like to keep the server spun down during periods of inactivity (I already have a script to do this). Then, when the instance is spun down and nginx gets a request for that instance, it will time out when trying to get a response from it. At this point, can I somehow trigger a shell command on the server to use EC2's command line tools to spin up the instance, then re-try the user's request after it has started?

© Server Fault or respective owner

Related posts about nginx

Related posts about amazon-ec2