From 0ebce31c9287cb97b626d61b62e83681b2864fe8 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Thu, 26 Jan 2023 15:07:12 +0100 Subject: HTTP: added route logging. - Configuration: added "/config/settings/http/log_route". Type: bool Default: false This adds configurability to the error log. It allows enabling and disabling logs related to how the router performs selection of the routes. - HTTP: logging request line. Log level: [notice] The request line is essential to understand which logs correspond to which request when reading the logs. - HTTP: logging route that's been discarded. Log level: [info] - HTTP: logging route whose action is selected. Log level: [notice] - HTTP: logging when "fallback" action is taken. Log level: [notice] Closes: Link: Link: Suggested-by: Timo Stark Suggested-by: Mark L Wood-Patrick Suggested-by: Liam Crilly Tested-by: Liam Crilly Acked-by: Artem Konev Cc: Andrew Clayton Cc: Andrei Zeliankou Reviewed-by: Zhidao Hong Signed-off-by: Alejandro Colomar --- src/nxt_router.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nxt_router.h') diff --git a/src/nxt_router.h b/src/nxt_router.h index 11094960..64095b69 100644 --- a/src/nxt_router.h +++ b/src/nxt_router.h @@ -197,6 +197,8 @@ typedef struct { nxt_str_t body_temp_path; + uint8_t log_route; /* 1 bit */ + uint8_t discard_unsafe_fields; /* 1 bit */ nxt_http_forward_t *forwarded; -- cgit From 1a485fed6a8353ecc09e6c0f050e44c0a2d30419 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Sat, 18 Mar 2023 16:32:59 +0000 Subject: Allow to remove the version string in HTTP responses. Normally Unit responds to HTTP requests by including a header like Server: Unit/1.30.0 however it can sometimes be beneficial to withhold the version information and in this case just respond with Server: Unit This patch adds a new "settings.http" boolean option called server_version, which defaults to true, in which case the full version information is sent. However this can be set to false, e.g "settings": { "http": { "server_version": false } }, in which case Unit responds without the version information as the latter example above shows. Link: Closes: Reviewed-by: Alejandro Colomar Signed-off-by: Andrew Clayton --- src/nxt_router.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nxt_router.h') diff --git a/src/nxt_router.h b/src/nxt_router.h index 64095b69..6f0ba5ad 100644 --- a/src/nxt_router.h +++ b/src/nxt_router.h @@ -201,6 +201,8 @@ typedef struct { uint8_t discard_unsafe_fields; /* 1 bit */ + uint8_t server_version; /* 1 bit */ + nxt_http_forward_t *forwarded; nxt_http_forward_t *client_ip; -- cgit From a3c3a29493798873ad04922bb2a7180b2ce267d5 Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Mon, 8 May 2023 16:00:25 +0800 Subject: NJS: supported loadable modules. --- src/nxt_router.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nxt_router.h') diff --git a/src/nxt_router.h b/src/nxt_router.h index 6f0ba5ad..b14f8410 100644 --- a/src/nxt_router.h +++ b/src/nxt_router.h @@ -74,6 +74,10 @@ typedef struct { nxt_queue_t tls; /* of nxt_router_tlssock_t */ #endif +#if (NXT_HAVE_NJS) + nxt_queue_t js_modules; +#endif + nxt_queue_t apps; /* of nxt_app_t */ nxt_queue_t previous; /* of nxt_app_t */ -- cgit