Skip to content

Commit

Permalink
added Server-Timing header nginx level
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeybannov committed Jul 29, 2024
1 parent 1b1be72 commit a376f1f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions config/nginx/onlyoffice.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a376f1f

Please sign in to comment.