Hello!
On Wed, Jul 18, 2012 at 8:23 PM, Belton Kwong wrote:
> Hi agentzh,
>
> You are right, I checked the error log and it said,
>
> 2012/07/19 11:09:03 [error] 17615#0: *19 neither the "$memc_value" variable nor the request body is available while sending to client, client: ********, server: _, request: "GET /hk HTTP/1.1", host: "**************", referrer: "http://**************/"
>
> How do I set the request body to send to the client? I thought it is done automatically. I am guess if it does not work with proxy_pass. How could I use in conjunction?
>
As you have already been suggested, you should really really use the
ngx_srcache module. It can be used with ngx_memc and ngx_proxy to do
caching for the ngx_proxy responses with your memcached servers. Read
its documentation for configuration samples:
http://wiki.nginx.org/HttpSRCacheModule
Please do that.
BTW, you should never use memc_pass and proxy_pass in a single nginx
location because they both register a "content handler" in the nginx
terminology. You're highly recommended to read the Nginx tutorials on
the nginx basics to prevent such common mistakes:
http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-enuk.html
or the Chinese version if your prefer:
http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html
Best regards,
-agentzh