Welcome! Log In Create A New Profile

Advanced

set cache-control in a subfolder (php)

November 17, 2016 04:17AM
Hi I'm trying to override my default cache-control in my /admin/ folder

location /admin/ {
add_header “Cache-Control: no-cache”;
try_files $uri =404;
access_log off;
}

but everything have a wrong cache-age by running curl -I

curl -I https://domain/admin/index.php
HTTP/1.1 302 Moved Temporarily
Server: nginx
Date: Thu, 17 Nov 2016 09:10:02 GMT
Content-Type: text/html;charset=utf-8
Connection: keep-alive
Set-Cookie: PHPSESSID=hf3slpa33833dt3hl168m4sv24; expires=Fri, 18-Nov-2016 09:10:02 GMT; Max-Age=86400; path=/
Expires: Sat, 19 Nov 2016 21:10:02 GMT
Cache-Control: public, max-age=216000
Last-Modified: Sat, 21 May 2016 01:04:48 GMT
Location: https://domain/admin/login.php?referrer=/admin/index.php
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff


I've tried all the directives from http://nginx.org/en/docs/http/ngx_http_headers_module.html#expires to try overriding this

My goal is to have no-cache on all php files in this subfolder. Any one who could help me?
Subject Author Posted

set cache-control in a subfolder (php)

JoakimR November 17, 2016 04:17AM

Re: set cache-control in a subfolder (php)

Francis Daly November 17, 2016 08:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 79
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready