0

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.

Hrishikesh_Pardeshi
  • 995
  • 4
  • 19
  • 45

2 Answers2

1

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

VBart
  • 14,714
  • 4
  • 45
  • 49
0

try replacing http://127.0.0.1:11211 with localhost:11211

memcached_pass     localhost:11211;

And check that the memcached server is running, just to make sure.

Mohammad AbuShady
  • 40,884
  • 11
  • 78
  • 89
  • Pardon my ignorance, but in order to check that the memcached server is running, I need to make http://localhost:11211 request, right ? Replacing the ip with server name doesn't help. – Hrishikesh_Pardeshi Aug 12 '13 at 09:51
  • well you are running windows, so I'm not sure how that's done there, I guess the simplest way is trying to see if there's an application listening on port 11211 using `netstat -a -n` or just start the server again using the exe ( i found some pages using `c:\memcached\memcached.exe -d start` of course depends on where you installed memcached ), If the server is already working then it should fail and say that the port is already taken, otherwise it would start the server. – Mohammad AbuShady Aug 12 '13 at 10:10
  • I started off the memcached server using the exe, the result is still the same. When I ignore the memcached_pass directive and everything works fine, memcache admin is available at port 85 which shows the stats for server at 11211. But, in the current case, connection to port 85 also fails. – Hrishikesh_Pardeshi Aug 12 '13 at 10:24