Can't get Nginx to work with memcached

sayeo87 nginx-forum at nginx.us
Thu May 28 06:43:58 MSD 2009


Hi, 

I think I'm having trouble even getting the most basic case of Nginx+memcached working properly. Here is my /etc/nginx/nginx.conf file:


user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    access_log	/var/log/nginx/access.log;

    sendfile        on;
    tcp_nopush     on;

    #keepalive_timeout  0;
    tcp_nodelay        on;

    gzip  on;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;

	upstream backend {
    	server 127.0.0.1:81;
	}
	
	server{
		listen 80;
		location / {
			set $memcached_key $uri;
			memcached_pass     127.0.0.1:11211;
			default_type	   text/html;
			error_page         404 = /fetch;
		}

		location =/fetch {
			proxy_pass http://backend;
			break;
		}
	}
}


I have nginx running on localhost:80 and an apache server on localhost:81. With this setup, when running memcached -vv, I should see output whenever any HTTP request is sent to the nginx server, because it should be searching for cached items, right? However I see absolutely no output from memcached -vv.....

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,2438,2438#msg-2438






More information about the nginx mailing list