Welcome! Log In Create A New Profile

Advanced

reqrite + expire header

Posted by Eppi 
reqrite + expire header
December 11, 2013 08:46AM
Hallo,

ich lasse per Script nicht vorhandene Bilder erstellen:
if (!-e $request_filename) {
rewrite ^(.*)$ /image.php last;
}

Für alle vorhandenen möchte ich gern den expire header ändern.
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
access_log off;
add_header Pragma public;
add_header Cache-Control "public";
}

Leider funktioniert nicht beides gleichzeitig. Habt Ihr eine Idee?
Das ganze sieht bei mir aktuell so aus:
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /image.php last;
}
root /home/objektpic;
index index.php;

location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
access_log off;
add_header Pragma public;
add_header Cache-Control "public";
}
}

gruß, paul
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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