Skip to content

Instantly share code, notes, and snippets.

@yhsiang
Created May 11, 2015 06:49
Show Gist options
  • Save yhsiang/9875f5505a7d24f525e0 to your computer and use it in GitHub Desktop.
Save yhsiang/9875f5505a7d24f525e0 to your computer and use it in GitHub Desktop.
nginx for sayit
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
upstream sayit_upstream {
server 127.0.0.1:8000;
keepalive 64;
}
server {
listen 80;
server_name localhost;
location / {
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Connection "";
proxy_cache one;
proxy_cache_key sfs$request_uri$scheme;
proxy_pass http://sayit_upstream;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment