Skip to content

Instantly share code, notes, and snippets.

View justinriggio's full-sized avatar

Justin Riggio justinriggio

  • NYC
View GitHub Profile
upstream my_upstream { #this line starts the list of real resources that exist behind the nginx server
server 127.0.0.1:1337;
server 127.0.0.1:1338; #these servers are used in the order they are defined, in round robin fashion. there's more ways of load balancing in the docs
server 127.0.0.1:1339 backup; #amazingness no.1, the keyword "backup" means that this server should only be used when the rest are non-responsive
keepalive 64;
}
server {
listen 80;
location /resource.html { #in my example the server only responds to requests for the file /request.html