Welcome! Log In Create A New Profile

Advanced

Exclude images from location

Posted by havenskys 
Exclude images from location
April 19, 2018 11:05AM
So far after several attempts and reading the manuals I am still unable to get a clear and working response to how to exclude a path from ngnix.

Please only reply if you ACTUALLY KNOW what you're doing, no online trolls or bullies, not references to someone else, I took the time to type this so can you.
The answer to this is probably a single line so please be respectful, people read what you put on the internet.

location /path/prefix {
#no entries
}
location ~* \.(png|gif)$ {
expires 30d;
}

I've tried the various ways to do this and none appear to work.
What I want is for images under /path/prefix to go through apache(where I've got rewrite working) every time so exclude /path/prefix from all nginx caching.

I've tried the # no entries style and that does nothing.
I've tried all these variations and none have worked.

expires off;
expires epoch; (not at the same time as off, obviously.)
proxy_no_cache 1;
proxy_pass http://127.0.0.1:8080
add_header Cache-Control 'no-store, no-cache..."


Thanks.
Jon
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 320
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