added Server-Timing header nginx level

This commit is contained in:
Alexey Bannov 2024-07-29 16:15:19 +03:00
parent 1b1be72fdd
commit a376f1f5ed

View File

@ -54,6 +54,16 @@ map $request_uri $content_security_policy {
~*\/(ds-vpath)\/ "default-src *; script-src * 'unsafe-inline' 'unsafe-eval'; script-src-elem * 'unsafe-inline'; img-src * data:; style-src * 'unsafe-inline' data:; font-src * data:; frame-src * ascdesktop:; object-src; connect-src * ascdesktop:;";
}
map $request_time $request_time_ms {
# Simple case for 0.000
~^0\.000$ 0;
# If 0 before decimal place, must remove leading zeros after it
~^0\.(?:0*)([^0].*)$ $1;
# Otherwise just concatenate the full pre- & post-decimal parts
~^([^0][^.]*)\.(.*)$ $1$2;
}
include /etc/nginx/includes/onlyoffice-*.conf;
server_names_hash_bucket_size 128;
@ -288,6 +298,9 @@ server {
}
location /api/2.0 {
add_header Trailer Server-Timing;
add_header Server-Timing "http.server-request-time;dur=${request_time_ms}";
location ~* /(files|privacyroom) {
proxy_pass http://127.0.0.1:5007;
}