Skip to content

Fix log format string quotation in nginx config

What does this MR do and why?

Fix log format string quotation in nginx config

If the log format is not enclosed in 'single quotes' the spaces inside the log format are ignored (syntactical whitespace). The "double quotes" are then interpreted, meaning the spaces inside "double quotes" work but the quotes themselves are not actually output to the log files.

See also the "log_format combined" predefinition in nginx docs. https://nginx.org/en/docs/http/ngx_http_log_module.html#log_format

Screenshots or screen recordings

Before this change access log is: (I do some SNIP for privacy IP/versions.)

SNIP_IPV6::1000--[05/May/2023:02:00:49 +0200]POST /api/v4/jobs/request HTTP/1.12040gitlab-runner SNIP (HEAD; goSNIP; linux/ppc64le)

After this change access log is:

SNIP_IPV6::1000 - - [05/May/2023:02:02:52 +0200] "POST /api/v4/jobs/request HTTP/1.1" 204 0 "" "gitlab-runner SNIP (HEAD; goSNIP; linux/ppc64le)"

MR for Omnibus is omnibus-gitlab!6862 (closed).

How to set up and validate locally

Apply change, reload/restart nginx, view access log file.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Melvin Vermeeren

Merge request reports

Loading