Skip to content

Instantly share code, notes, and snippets.

@actsasflinn
Created January 14, 2010 05:05
Show Gist options
  • Save actsasflinn/276891 to your computer and use it in GitHub Desktop.
Save actsasflinn/276891 to your computer and use it in GitHub Desktop.
# nginx with memcache module... after a request the connection to memcached closes, what gives?
http {
upstream memcache {
server 127.0.0.1:11211;
keepalive 1024 single; # with this or without http://mdounin.ru/hg/ngx_http_upstream_keepalive/
}
server {
listen 80;
server_name localhost;
location @fallback {
root /data/myapp/current/public;
passenger_enabled on;
}
location / {
set $memcached_key 'thekey';
memcached_pass memcache;
default_type text/html;
error_page 404 502 = @fallback;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment