From 4f19f13d513af90e37c6b3afbac2e85e39e3b632 Mon Sep 17 00:00:00 2001 From: sophia chen Date: Mon, 27 Oct 2025 14:52:06 +1100 Subject: [PATCH] only log request path and status --- examples/cstg/nginx/default.conf.template | 30 +++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/examples/cstg/nginx/default.conf.template b/examples/cstg/nginx/default.conf.template index 8caa0308..917e5d35 100644 --- a/examples/cstg/nginx/default.conf.template +++ b/examples/cstg/nginx/default.conf.template @@ -1,17 +1,21 @@ -server { - listen 80; - server_name localhost; - root /usr/share/nginx/html; +http { + log_format path_status '$request_uri $status $remote_addr'; - #access_log /var/log/nginx/host.access.log main; + server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; - location / { - sub_filter '{{ UID_JS_SDK_URL }}' '${UID_JS_SDK_URL}'; - sub_filter '{{ UID_JS_SDK_NAME }}' '${UID_JS_SDK_NAME}'; - sub_filter '{{ UID_BASE_URL }}' '${UID_BASE_URL}'; - sub_filter '{{ SERVER_PUBLIC_KEY }}' '${SERVER_PUBLIC_KEY}'; - sub_filter '{{ SUBSCRIPTION_ID }}' '${SUBSCRIPTION_ID}'; - sub_filter_types *; - sub_filter_once off; + access_log /var/log/nginx/access.log path_status; + + location / { + sub_filter '{{ UID_JS_SDK_URL }}' '${UID_JS_SDK_URL}'; + sub_filter '{{ UID_JS_SDK_NAME }}' '${UID_JS_SDK_NAME}'; + sub_filter '{{ UID_BASE_URL }}' '${UID_BASE_URL}'; + sub_filter '{{ SERVER_PUBLIC_KEY }}' '${SERVER_PUBLIC_KEY}'; + sub_filter '{{ SUBSCRIPTION_ID }}' '${SUBSCRIPTION_ID}'; + sub_filter_types *; + sub_filter_once off; + } } } \ No newline at end of file