conditional behaviour based on Accept: values
Manlio Perillo
manlio_perillo at libero.it
Fri Mar 7 21:14:33 MSK 2008
gabriele renzi ha scritto:
> [...]
>> To avoid the triple memcache_pass, you can just do:
> <snip/>
>
> no I just meant to avoid writing it 3 times, but with current nginx
> this seems to work as I expect it:
>
Yes, I forgot to remove the memcached_pass directives in the `if` :).
> if ($http_accept ~* rdf) {
> set $memcached_key DATA$uri-$args.rdf;
> }
> if ($http_accept ~* json) {
> set $memcached_key DATA$uri-$args.json;
> }
> if ($http_accept ~* plain) {
> set $memcached_key DATA$uri-$args.txt;
> }
> memcached_pass memcached;
>
> next I'll have to check if I can do "set $key $key.foo" :)
>
key.foo what should return?
However no, it is not possible.
But check this extension I have written:
http://hg.mperillo.ath.cx/nginx/mod_parsed_vars/file/tip/README
> Thanks again for the help.
>
Ciao Manlio Perillo
More information about the nginx
mailing list