geetarista (owner)

Revisions

gist: 209348 Download_button fork
public
Public Clone URL: git://gist.github.com/209348.git
Embed All Files: show embed
nginx-memcached.conf #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Taken from: http://www.pauldix.net/2009/10/using-the-nginx-memcached-module-with-passenger.html
 
user nobody nogroup;
worker_processes 4;
 
error_log logs/error.log;
 
events {
 worker_connections 1024;
}
 
http {
 passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5;
 passenger_ruby /usr/bin/ruby1.8;
 
 include mime.types;
 default_type application/octet-stream;
 tcp_nopush on;
 tcp_nodelay on;
 gzip on;
 
 sendfile on;
 
 keepalive_timeout 65;
 
 server {
 listen 80;
 server_name localhost; # put in your IP in place of localhost
 location / {
 set $memcached_key $uri;
 memcached_pass 127.0.0.1:11211;
 default_type application/json;
 error_page 404 502 = @fallback;
 }
 
 location @fallback {
 root /var/www/public;
 passenger_enabled on;
 }
 }
}