Update to 2022-02-09 14:00

This commit is contained in:
Daniel Berteaud 2022-02-09 14:00:12 +01:00
parent 8f15d01cbe
commit 71a429c7a2
5 changed files with 26 additions and 5 deletions

View File

@ -1,4 +1,4 @@
map $upstream_http_content_type $is_cacheable { map $sent_http_content_type $is_client_cacheable {
default 0; default 0;
~image/ 1; ~image/ 1;
~audio/ 1; ~audio/ 1;
@ -14,3 +14,12 @@ map $upstream_http_content_type $is_cacheable {
application/vnd.ms-fontobject 1; application/vnd.ms-fontobject 1;
application/vnd.ms-opentype 1; application/vnd.ms-opentype 1;
} }
map $request_uri $is_proxy_cacheable {
default 0;
~*\.(png|jpe?g|bmp|gif|webp)$ 1;
~*\.(js|css|txt)$ 1;
~*\.(pdf)$ 1;
~*\.(ttf|ott)$ 1;
~*\.(mp3|mp4|avi|mpe?g|mov|flv)$ 1;
}

View File

@ -5,7 +5,7 @@ proxy_cache_path /var/cache/nginx
inactive=300m inactive=300m
use_temp_path=off; use_temp_path=off;
map $is_cacheable $no_cache { map $is_proxy_cacheable $no_cache {
default 1; default 1;
1 0; 1 0;
} }

View File

@ -1,8 +1,8 @@
map $is_cacheable $custom_expires { map $is_client_cacheable $custom_expires {
default epoch; default epoch;
1 7d; 1 7d;
} }
map $is_cacheable $custom_cache_control { map $is_client_cacheable $custom_cache_control {
default "no-cache, no-store, private"; default "no-cache, no-store, private";
1 "public, max-age=604800, must-revalidate, proxy-revalidate"; 1 "public, max-age=604800, must-revalidate, proxy-revalidate";
} }

View File

@ -11,7 +11,13 @@ gzip_types
application/rss+xml application/rss+xml
application/atom_xml application/atom_xml
application/x-javascript application/x-javascript
application/javascript; application/javascript
application/font-sfnt
font/opentype
font/ttf
application/font-woff
application/vnd.ms-fontobject
application/vnd.ms-opentype;
gzip_vary on; gzip_vary on;
gzip_disable "msie6"; gzip_disable "msie6";
expires $custom_expires; expires $custom_expires;

View File

@ -2,5 +2,11 @@ include /etc/onlyoffice/documentserver/nginx/includes/http-common.conf;
server { server {
listen 0.0.0.0:80; listen 0.0.0.0:80;
server_name {{ oo_ds_vhost }}; server_name {{ oo_ds_vhost }};
# Override the fonts endpoint to add a Content-Type so reverse proxies can handle caching corectly
location ~ ^(\/[\d]+\.[\d]+\.[\d]+[\.|-][\d]+)?\/fonts(\/.*)$ {
add_header Content-Type font/opentype;
expires 365d;
alias /var/www/onlyoffice/documentserver/fonts$2;
}
include /etc/onlyoffice/documentserver/nginx/includes/ds-docservice.conf; include /etc/onlyoffice/documentserver/nginx/includes/ds-docservice.conf;
} }