From 53495a0b8384480d1d77416f9f0c96b9b6e343e2 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 23 Aug 2025 18:54:29 +0300 Subject: [PATCH] edit nginx --- nginx.conf | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 908f3c4..b4fea30 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,3 +1,5 @@ +log_format main '$time_iso8601 [$request_id] $remote_addr "$request" $status $body_bytes_sent $request_time'; + server { listen 80; server_name _; @@ -7,11 +9,17 @@ server { client_body_timeout 300s; client_header_timeout 300s; + # Access logs with request id + access_log /var/log/nginx/access.log main; + root /usr/share/nginx/html; index index.html; location / { try_files $uri /index.html; + # Propagate a request id to clients; backend (API) can echo as session id + add_header X-Request-Id $request_id always; + add_header X-Content-Type-Options nosniff always; + add_header Referrer-Policy no-referrer-when-downgrade always; } } -