Nginx的配置如下:
$('#calendar').fullCalendar({
eventSources: [
{
url: 'api/test.php'
}
]
});
我的要求是不让“ cauth | preview”字符占用缓存,现在配置仍被缓存。 例如,让以下网址不进入缓存
location ~* /apadlibrary/.*GetJpgUrl.aspx.* {
if ( $request_uri ~* "cauth|preview" )
{
proxy_pass http://usp_sub;
break;
}
proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_pass http://usp_sub;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:$server_port;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
proxy_ignore_headers Expires;
proxy_ignore_headers Cache-Control;
proxy_cache cache_one;
proxy_cache_valid 301 302 24h;
add_header Nginx-Cache "$upstream_cache_status";
expires 1d;
}
其他包括/ apadlibrary /。 GetJpgUrl.aspx。,获取缓存。