# Nginx+memcached produces odd Quotation mark!

**URL:** <https://www.ruby-forum.com/t/nginx-memcached-produces-odd-quotation-mark/144515>\
**Category:** NGINX\
**Created:** [July 30, 2008, 3:16pm UTC](https://www.ruby-forum.com/t/nginx-memcached-produces-odd-quotation-mark/144515 "2008-07-30T15:16:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/96bed5/32.png) [@zhan](https://www.ruby-forum.com/u/zhan)\
**Post date:** [July 30, 2008, 3:16pm UTC](https://www.ruby-forum.com/t/nginx-memcached-produces-odd-quotation-mark/144515/1 "2008-07-30T15:16:32Z")

</div>

When I tried to use nginx and memcached module,  
the output always had a odd quotation mark  
before the cached content.

I have tried nginx/0.6.32 and nginx 0.5.34  
I used:  
ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux] and  
ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-darwin9]  
with  
memcached 1.2.5  
libmemcached 0.22  
memcached gem 0.11  
or  
memcached-client 1.5.0

here is my nginx conf file:  
worker\_processes 1;  
pid /www/logs/nginx.pid;  
events {  
worker\_connections 1024;  
}  
http {  
server {  
listen 80;  
server\_name localhost;  
location / {  
default\_type text/html;  
set $memcached\_key $uri;  
memcached\_pass localhost:11211;  
}  
}  
}

after I setup a cache:  
irb(main):002:0\> require ‘memcached’  
=\> true  
irb(main):003:0\> c = Memcached.new(‘localhost:11211’)  
#…  
irb(main):006:0\> c.set ‘/test’, ‘hello’

when I opened 127.0.0.1/test with safari 3.0 or  
Firefox 3, I didn’t get  
hello  
but:  
"hello

I get no idea where the Quotation mark coming from!!!  
Can anyone tell me how to fix it?

---

<div class="post-metadata">

**Author:** ![zhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/96bed5/32.png) [@zhan](https://www.ruby-forum.com/u/zhan)\
**Post date:** [July 30, 2008, 4:19pm UTC](https://www.ruby-forum.com/t/nginx-memcached-produces-odd-quotation-mark/144515/2 "2008-07-30T16:19:16Z")

</div>

if you run memcached in verbose mode “memcached -vv” does it display  
the quote upon retrieving the key?

---

<div class="post-metadata">

**Author:** ![zhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/96bed5/32.png) [@zhan](https://www.ruby-forum.com/u/zhan)\
**Post date:** [July 30, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/nginx-memcached-produces-odd-quotation-mark/144515/3 "2008-07-30T17:10:16Z")

</div>

I started memcached with “memcached -vv”, I saw no cache content being  
shown:  
memcached -vv  
slab class 1: chunk size 88 perslab 11915  
…  
slab class 39: chunk size 489032 perslab 2  
\<6 server listening  
\<7 send buffer was 105472, now 268435456  
\<7 server listening (udp)  
\<8 new client connection  
\<8 get /test

> 8 END  
> \<8 connection closed.  
> \<8 new client connection  
> \<8 get /favicon.ico  
> 8 END  
> \<8 connection closed.  
> \<8 new client connection  
> \<8 set /test 0 0 9  
> 8 STORED  
> \<9 new client connection  
> \<9 get /test  
> 9 sending key /test  
> 9 END  
> \<9 connection closed.

But I noticed an interesting thing: ‘/favicon.ico’ was requested now and  
then. Do you think it may cause the problem?

---

<div class="post-metadata">

**Author:** ![zhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/96bed5/32.png) [@zhan](https://www.ruby-forum.com/u/zhan)\
**Post date:** [July 30, 2008, 5:17pm UTC](https://www.ruby-forum.com/t/nginx-memcached-produces-odd-quotation-mark/144515/4 "2008-07-30T17:17:52Z")

</div>

I have just modified the nginx conf file and restarted nginx to filter  
all  
/favicon.ico request.worker\_processes 1;  
pid /www/logs/nginx.pid;  
events {  
worker\_connections 1024;  
}  
http {  
server {  
listen 80;  
server\_name localhost;  
#access\_log /www/logs/loc.access.log;  
location / {  
default\_type text/html;  
set $memcached\_key $uri;  
memcached\_pass localhost:11211;  
}

```
    location /favicon.ico {
       root /www/loc/public/images;
    }

}

```

}

But the quotation mark didn’t go away.
