worker_processes 2; ## Default: 1 error_log /error.log; pid /nginx.pid; worker_rlimit_nofile 8192; events { worker_connections 4096; ## Default: 1024 } http { include /etc/nginx/mime.types; index index.html default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] $status ' '"$request" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /access.log main; sendfile on; tcp_nopush on; server_names_hash_bucket_size 128; # this seems to be required for some vhosts gzip on; gzip_disable "msie6"; gzip_vary on; gzip_comp_level 3; gzip_buffers 16 8k; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; server { listen 9010; server_name blog; location / { root /usr/share/nginx/html; index index.html index.htm; expires -1; add_header Pragma "no-cache"; add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"; try_files $uri$args $uri$args/ $uri $uri/ /index.html =404; } # serve static files location ~ ^/(images|javascript|js|css|flash|media|static)/ { root /usr/share/nginx/html; expires 30d; } location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { root /usr/share/nginx/html; expires 30d; } error_page 405 =200 $uri; } }