Search code examples
nginxmemcachedhttpserverwinginx

memcached not working on winginx


I am planning to try out memcached with winginx on windows 7. I have the following configuration currently:

        location / {
            root home/$host/public_html/static;
            try_files $uri @def;
        }

        location @def {
            proxy_pass http://127.0.0.1:4711;
        }

        location @xyz {
            set $memcached_key $uri;
        #   memcached_pass     http://127.0.0.1:11211;
            default_type       text/html;
            error_page         404 = @fallback;
        }

        location @fallback {
            proxy_pass http://127.0.0.1:4711;
        }

As you see, the memcached_pass is commented out, if I uncomment it, I get a connection error when trying to access anything on the nginx server. The location @xyz directive is unused and should not break anything.

Any help is appreciated.


Solution

  • You should remove http:// from your memcached_pass directive. See the docs: http://nginx.org/r/memcached_pass