HTTP GEO Module and Memcached Module question

Evan Miller emmiller+gmane at gmail.com
Sat Apr 28 21:23:24 MSD 2007


Liang Jin <mywebadmin at ...> writes:
> For example, if I set the key value in memcached in text format as
> "whatever", nginx can query and get the value and feed it back to the
> client browser. However, the question is: even if the text is valid
> HTML, the browser still thinks it is data, not web pages, so it offers
> me to download. I guess I need to set extra headers before the HTML in
> order to make it work, but I cannot find any information on this.

I ran into this same problem (being that Memcache just serves up data and won't
tell Nginx what type of data it is). I think the best solution is to set the
"default_type" in your configuration based on which key it's getting, e.g.,

  location /html {
      memcached_pass 127.0.0.1:11211;
      default_type text/html;
  }

  location /javascript {
      memcached_pass 127.0.0.1:11211;
      default_type text/javascript;
  }

Should work for most uses.

Evan


> 
> Thanks.
> 
> -Liang
> 
> 










More information about the nginx mailing list