Skip to content

Instantly share code, notes, and snippets.

@rschildmeijer
Created October 10, 2010 20:10
Show Gist options
  • Save rschildmeijer/619522 to your computer and use it in GitHub Desktop.
Save rschildmeijer/619522 to your computer and use it in GitHub Desktop.
#user rogerschildmeijer;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use kqueue;
}
http {
upstream frontends {
server 127.0.0.1:8881;
server 127.0.0.1:8882;
server 127.0.0.1:8883;
server 127.0.0.1:8884;
}
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
# keepalive_timeout 65;
proxy_read_timeout 200;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_types text/plain text/html text/css text/xml
application/x-javascript application/xml
application/atom+xml text/javascript;
proxy_next_upstream error;
server {
listen 80;
keepalive_timeout 70;
client_max_body_size 50M;
location ^~ /static/ {
root /var/www;
if ($query_string) {
expires max;
expires max;
}
}
location = /favicon.ico {
rewrite (.*) /static/favicon.ico;
}
location = /robots.txt {
rewrite (.*) /static/robots.txt;
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect false;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://frontends;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment