设置FACTCGI不缓存

时间:2018-07-19 16:32:53

标签: php nginx caching fastcgi

是否可以在Nginx中禁用授权标头的FASTCGI缓存?以与以下规则相同的方式?

    #Cache everything by default
set $no_cache 0;

#Don't cache POST requests
if ($request_method = POST)
{
    set $no_cache 1;
}

#Don't cache if the URL contains a query string
if ($query_string != "")
{
    set $no_cache 1;
}

#Don't cache the following URLs
if ($request_uri ~* "/(administrator/|login.php)")
{
    set $no_cache 1;
}

#Don't cache if there is a cookie called PHPSESSID
if ($http_cookie = "PHPSESSID")
{
    set $no_cache 1;
}

0 个答案:

没有答案