В конфиге сайта при добавлении в location типа содержимого для кэширования оно вобще перестает отображаться на сайте. Например если в строку location ~* \.(doc|xls|gz|bz2|zip|rar|js)$ добавить к примеру jpg то перестают грузиться картинки... Подскажите пожалуйста куда смотреть?
Конфиг nginx:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {worker_connections 65535;}
http {
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format bytes '$body_bytes_sent';
access_log /var/log/nginx/access.log main;
proxy_cache_path /var/www/cache/files levels=1:2 keys_zone=full:500m inactive=60m max_size=4096m;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/mime.types;
default_type application/octet-stream;
Конфиг сайта:
server {
listen 80;
server_name site www.site;
rewrite ^(.*)
https://$host$1 permanent;
}
server {
listen 443;
server_name site www.site;
access_log /var/log/nginx/site_access.log;
error_log /var/log/nginx/site_error.log;
ssl on;
ssl_certificate /etc/letsencrypt/live/site/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/site/privkey.pem;
location ~* \.(doc|xls|gz|bz2|zip|rar|js)$ {
add_header Cache-Control "max-age=2592000, public";
proxy_pass
http://127.0.0.1:81;
proxy_cache full;
proxy_cache_valid 200 60m;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
location / {
proxy_pass
127.0.0.1:81/;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_connect_timeout 60;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_redirect off;
proxy_set_header Connection close;
proxy_pass_header Content-Type;
proxy_pass_header Content-Disposition;
proxy_pass_header Content-Length;
}
location @fallback {
proxy_pass
http://127.0.0.1:81;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
}