Welcome! Log In Create A New Profile

Advanced

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

Francis Daly
November 17, 2016 08:50AM
On Thu, Nov 17, 2016 at 04:17:36AM -0500, JoakimR wrote:

Hi there,

> Hi I'm trying to override my default cache-control in my /admin/ folder

One request is handled in one location.

Only the config that applies in that location applies to the request.

> 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

That suggests that the request for /admin/index.php is not handled in
the location that you show.

Put the config that you want in the location that is used; or perhaps
make a new location for the requests that you care about, and make all
of the config that matters apply in that location.

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

Populate "location ~ ^/admin/*.php$ {}", perhaps?

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
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: 244
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready