worker_processes 1; events { worker_connections 1024; multi_accept on; } http { include mime.types; default_type text/plain; tcp_nodelay on; tcp_nopush on; reset_timedout_connection on; send_timeout 2; charset UTF-8; sendfile on; keepalive_timeout 65; gzip on; gzip_vary on; gzip_types text/plain text/css; fastcgi_cache_path /www/nginx-cache levels=1:2 keys_zone=WERC:200m inactive=1200m; fastcgi_cache_key "$scheme$request_method$host$request_uri"; fastcgi_cache_valid 1w; fastcgi_ignore_headers Cache-Control Expires Set-Cookie; add_header X-Battleship $upstream_cache_status; server_tokens off; server { listen 80; server_name n-gate.com; set $werchome /www/werc/; # Location of your werc installation root $werchome/sites/$host/; index index.html; access_log /var/log/nginx/n-gate.access.log; error_log /var/log/nginx/n-gate.error.log; location / { try_files $uri @werc; expires 1M; add_header Cache-Control "public"; } location /pub/ { root $werchome; try_files $uri =404; expires 1M; add_header Cache-Control "public"; } location /privacy_policy { return 451 "451: This document is not available to you."; } error_page 404 = @werc; location @werc { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $werchome/bin/werc.rc; fastcgi_pass unix:/www/slowcgi.sock; fastcgi_cache WERC; } } }