Skip to content

Instantly share code, notes, and snippets.

@mariuz
Created April 3, 2009 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariuz/89628 to your computer and use it in GitHub Desktop.
Save mariuz/89628 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name www.example.com;
# serve static files
location ~ ^/(img|images|javascript|js|css|flash|media|static)/ {
root /var/www/www;
# expires 30d;
}
location / {
proxy_pass http://foobar_balancer;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect false;
}
gzip_min_length 1000;
gzip_types text/html text/plain text/css text/javascript application/x-javascript text/xml;
}
upstream foobar_balancer {
server copycat1.example.com:8000;
server copycat2.example.com:80;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment