Hello there i need to set the proxy_cache value to off when the user user agent is from a mobile browser.
I've already did the if and it's working perfectly but i can't put the proxy_cache off directive inside. Could someone please help me ?
Is there a workaround ? I would like to serve ever the cached version to every user except for mobile people.
Please i'm getting crazy. Cheers
PS : Right now i had to set the proxy_cache off by default because of this. This is the part of my config file
location / {
# proxy_cache cache;
# proxy_cache_valid any 1m;
if ($http_user_agent ~* .*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/W$
# rewrite ^(.*)$ http://www.androidiani.com/NOCACHE/$1 permanent;
}
proxy_pass http://127.0.0.1:80;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}