Задать заголовки 304 Last-modified Not-modified через nginx
Здравствуйте. Freebsd. Nginx - 1.6.2. Связка Nginx+php-fpm. Кеширование осущесвляется через nginx.
Необходим настроить передачу корретных заголовков 304. Никак не получается заставить отдавать заголовки 304.
Вот конфиг
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */ .c.geshi_code {font-family:monospace;} .c.geshi_code .imp {font-weight: bold; color: red;} .c.geshi_code .kw1 {color: #b1b100;} .c.geshi_code .kw2 {color: #000000; font-weight: bold;} .c.geshi_code .kw3 {color: #000066;} .c.geshi_code .kw4 {color: #993333;} .c.geshi_code .co1 {color: #666666; font-style: italic;} .c.geshi_code .co2 {color: #339933;} .c.geshi_code .coMULTI {color: #808080; font-style: italic;} .c.geshi_code .es0 {color: #000099; font-weight: bold;} .c.geshi_code .es1 {color: #000099; font-weight: bold;} .c.geshi_code .es2 {color: #660099; font-weight: bold;} .c.geshi_code .es3 {color: #660099; font-weight: bold;} .c.geshi_code .es4 {color: #660099; font-weight: bold;} .c.geshi_code .es5 {color: #006699; font-weight: bold;} .c.geshi_code .br0 {color: #009900;} .c.geshi_code .sy0 {color: #339933;} .c.geshi_code .st0 {color: #ff0000;} .c.geshi_code .nu0 {color: #0000dd;} .c.geshi_code .nu6 {color: #208080;} .c.geshi_code .nu8 {color: #208080;} .c.geshi_code .nu12 {color: #208080;} .c.geshi_code .nu16 {color:#800080;} .c.geshi_code .nu17 {color:#800080;} .c.geshi_code .nu18 {color:#800080;} .c.geshi_code .nu19 {color:#800080;} .c.geshi_code .me1 {color: #202020;} .c.geshi_code .me2 {color: #202020;} .c.geshi_code span.xtra { display:block; }
Необходим настроить передачу корретных заголовков 304. Никак не получается заставить отдавать заголовки 304.
Вот конфиг
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */ .c.geshi_code {font-family:monospace;} .c.geshi_code .imp {font-weight: bold; color: red;} .c.geshi_code .kw1 {color: #b1b100;} .c.geshi_code .kw2 {color: #000000; font-weight: bold;} .c.geshi_code .kw3 {color: #000066;} .c.geshi_code .kw4 {color: #993333;} .c.geshi_code .co1 {color: #666666; font-style: italic;} .c.geshi_code .co2 {color: #339933;} .c.geshi_code .coMULTI {color: #808080; font-style: italic;} .c.geshi_code .es0 {color: #000099; font-weight: bold;} .c.geshi_code .es1 {color: #000099; font-weight: bold;} .c.geshi_code .es2 {color: #660099; font-weight: bold;} .c.geshi_code .es3 {color: #660099; font-weight: bold;} .c.geshi_code .es4 {color: #660099; font-weight: bold;} .c.geshi_code .es5 {color: #006699; font-weight: bold;} .c.geshi_code .br0 {color: #009900;} .c.geshi_code .sy0 {color: #339933;} .c.geshi_code .st0 {color: #ff0000;} .c.geshi_code .nu0 {color: #0000dd;} .c.geshi_code .nu6 {color: #208080;} .c.geshi_code .nu8 {color: #208080;} .c.geshi_code .nu12 {color: #208080;} .c.geshi_code .nu16 {color:#800080;} .c.geshi_code .nu17 {color:#800080;} .c.geshi_code .nu18 {color:#800080;} .c.geshi_code .nu19 {color:#800080;} .c.geshi_code .me1 {color: #202020;} .c.geshi_code .me2 {color: #202020;} .c.geshi_code span.xtra { display:block; }
fastcgi_cache_path /www/www2/www3/fcgi-cache levels=1:2 keys_zone=*:500m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
server {
listen 80 default accept_filter=httpready;
server_name * ;
set $skip_cache 0;
error_page 404 /404.html;
error_page 403 =404 /;
location / {
root /www/www2/;
index index.php index.html index.htm;
access_log /var/log/www.com-access.log;
try_files $uri $uri/ /index.php?$args;
}
location ~ .php$ {
root /www/www2/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /$document_root$fastcgi_script_name;
include fastcgi_params;
try_files $uri /index.php;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache *;
fastcgi_cache_valid 200 304 60m;
}
location ~ /purge(/.*) {
fastcgi_cache_purge *"$scheme$request_method$host$1";
}
}
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
server {
listen 80 default accept_filter=httpready;
server_name * ;
set $skip_cache 0;
error_page 404 /404.html;
error_page 403 =404 /;
location / {
root /www/www2/;
index index.php index.html index.htm;
access_log /var/log/www.com-access.log;
try_files $uri $uri/ /index.php?$args;
}
location ~ .php$ {
root /www/www2/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /$document_root$fastcgi_script_name;
include fastcgi_params;
try_files $uri /index.php;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache *;
fastcgi_cache_valid 200 304 60m;
}
location ~ /purge(/.*) {
fastcgi_cache_purge *"$scheme$request_method$host$1";
}
}