Can't get Nginx to work with memcached

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


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/;

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 {
		listen 80;
		location / {
			set $memcached_key $uri;
			default_type	   text/html;
			error_page         404 = /fetch;

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

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:,2438,2438#msg-2438

More information about the nginx mailing list