HTTP GEO Module and Memcached Module question

Evan Miller emmiller+gmane at
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 {
      default_type text/html;

  location /javascript {
      default_type text/javascript;

Should work for most uses.


> Thanks.
> -Liang

More information about the nginx mailing list