diff --git a/docs/faq.md b/docs/faq.md index ea1e4d3085..cdce2d1fa7 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -139,7 +139,7 @@ set_real_ip_from 0.0.0.0/0; # Trust all IPs (use your VPC CIDR block in producti real_ip_header X-Forwarded-For; real_ip_recursive on; -log_format main '$remote_addr - $remote_user [$time_local] "$request" ' +log_format main '$remote_addr - $remote_user [$time_local] "$request_method $uri $server_protocol" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" ' 'host=$host x-forwarded-for=$http_x_forwarded_for'; @@ -197,4 +197,4 @@ used. [The configmap value is here](https://kubernetes.github.io/ingress-nginx/u the controller log messages show an error about duplicate header, it is because of this change -- More details are available in this issue +- More details are available in this issue \ No newline at end of file diff --git a/docs/user-guide/nginx-configuration/configmap.md b/docs/user-guide/nginx-configuration/configmap.md index d8b4f6693a..b57a83f0cf 100644 --- a/docs/user-guide/nginx-configuration/configmap.md +++ b/docs/user-guide/nginx-configuration/configmap.md @@ -68,7 +68,7 @@ The following table shows a configuration option's name, type, and the default v | [large-client-header-buffers](#large-client-header-buffers) | string | "4 8k" | | | [log-format-escape-none](#log-format-escape-none) | bool | "false" | | | [log-format-escape-json](#log-format-escape-json) | bool | "false" | | -| [log-format-upstream](#log-format-upstream) | string | `$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status $req_id` | | +| [log-format-upstream](#log-format-upstream) | string | `$remote_addr - $remote_user [$time_local] "$request_method $uri $server_protocol" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status $req_id` | | | [log-format-stream](#log-format-stream) | string | `[$remote_addr] [$time_local] $protocol $status $bytes_sent $bytes_received $session_time` | | | [enable-multi-accept](#enable-multi-accept) | bool | "true" | | | [max-worker-connections](#max-worker-connections) | int | 16384 | | @@ -1398,4 +1398,4 @@ _**default:**_ "false" _References:_ - [https://nginx.org/en/docs/http/ngx_http_core_module.html#absolute_redirect](https://nginx.org/en/docs/http/ngx_http_core_module.html#absolute_redirect) -- [https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.2](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.2) +- [https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.2](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.2) \ No newline at end of file diff --git a/docs/user-guide/nginx-configuration/log-format.md b/docs/user-guide/nginx-configuration/log-format.md index 9a75064807..bcca5293a5 100644 --- a/docs/user-guide/nginx-configuration/log-format.md +++ b/docs/user-guide/nginx-configuration/log-format.md @@ -4,7 +4,7 @@ The default configuration uses a custom logging format to add additional informa ``` log_format upstreaminfo - '$remote_addr - $remote_user [$time_local] "$request" ' + '$remote_addr - $remote_user [$time_local] "$request_method $uri $server_protocol" ' '$status $body_bytes_sent "$http_referer" "$http_user_agent" ' '$request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr ' '$upstream_response_length $upstream_response_time $upstream_status $req_id'; @@ -44,4 +44,4 @@ Additional available variables: Sources: - [Upstream variables](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#variables) -- [Embedded variables](https://nginx.org/en/docs/http/ngx_http_core_module.html#variables) +- [Embedded variables](https://nginx.org/en/docs/http/ngx_http_core_module.html#variables) \ No newline at end of file diff --git a/internal/ingress/controller/config/config.go b/internal/ingress/controller/config/config.go index beac1405d7..4beeba75cc 100644 --- a/internal/ingress/controller/config/config.go +++ b/internal/ingress/controller/config/config.go @@ -51,7 +51,7 @@ const ( brotliTypes = "application/xml+rss application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/javascript text/plain text/x-component" - logFormatUpstream = `$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status $req_id` + logFormatUpstream = `$remote_addr - $remote_user [$time_local] "$request_method $uri $server_protocol" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status $req_id` logFormatStream = `[$remote_addr] [$time_local] $protocol $status $bytes_sent $bytes_received $session_time`