Skip to content

Instantly share code, notes, and snippets.

@masatomo
Created January 16, 2010 04:57
Show Gist options
  • Save masatomo/278649 to your computer and use it in GitHub Desktop.
Save masatomo/278649 to your computer and use it in GitHub Desktop.
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64;
proxy_cache_path /usr/local/nginx/cache levels=1:2 keys_zone=my-cache:4m max_size=50m inactive=120m;
proxy_temp_path /usr/local/nginx/tmp;
upstream everblog_cluster {
ip_hash;
server localhost:4567 max_fails=5 fail_timeout=60;
}
server {
listen 80;
server_name blog.madoro.org;
error_log /var/log/everblog-error.log;
access_log /var/log/everblog-access.log;
gzip on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "MSIE 6\."; # IE6 has gzip problem
# Main location
location / {
proxy_pass http://everblog_cluster;
# cache start
proxy_cache my-cache;
proxy_cache_valid 200 302 60m;
proxy_cache_valid 404 1m;
# cache end
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;
if ($request_uri ~* "\.(ico|css|js|gif|jpe?g|png)\?[0-9]+$") {
expires max;
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment