Access log format, Proxy buffer size

Set access log format to json_combined
Increase proxy buffer sizes to fix frequent 502 errors on all sites
This commit is contained in:
2026-03-17 18:05:18 +00:00
parent 6308d32f8e
commit 50b13c34ef

View File

@@ -23,30 +23,30 @@ http {
resolver 8.8.8.8 valid=30s ipv6=off; resolver 8.8.8.8 valid=30s ipv6=off;
resolver_timeout 11s; resolver_timeout 11s;
# log_format json_combined escape=json '{' log_format json_combined escape=json '{'
# '"method":"$request_method",' '"method":"$request_method",'
# '"scheme":"$scheme",' '"scheme":"$scheme",'
# '"domain":"$host",' '"domain":"$host",'
# '"uri":"$request_uri",' '"uri":"$request_uri",'
# '"query_string":"$query_string",' '"query_string":"$query_string",'
# '"referer":"$http_referer",' '"referer":"$http_referer",'
# '"content_type":"$sent_http_content_type",' '"content_type":"$sent_http_content_type",'
# '"status": $status,' '"status": $status,'
# '"bytes_sent":$body_bytes_sent,' '"bytes_sent":$body_bytes_sent,'
# '"request_time":$request_time,' '"request_time":$request_time,'
# '"user_agent":"$http_user_agent",' '"user_agent":"$http_user_agent",'
# '"cache":"$upstream_cache_status",' '"cache":"$upstream_cache_status",'
# '"upstream_time": "$upstream_response_time",' '"upstream_time": "$upstream_response_time",'
# '"timestamp":"$time_iso8601",' '"timestamp":"$time_iso8601",'
# '"ip":"$http_x_forwarded_for"' '"ip":"$http_x_forwarded_for"'
# '}'; '}';
log_format VCOMBINED '$host:$server_port ' # log_format VCOMBINED '$host:$server_port '
'$remote_addr $remote_user [$time_local] ' # '$remote_addr $remote_user [$time_local] '
'"$request" $status $body_bytes_sent ' # '"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"'; # '"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access.log VCOMBINED; access_log /var/log/nginx/access.log json_combined;
error_log /var/log/nginx/error.log debug; error_log /var/log/nginx/error.log debug;
sendfile on; sendfile on;
@@ -64,9 +64,9 @@ http {
large_client_header_buffers 4 32k; large_client_header_buffers 4 32k;
# If using Nginx as a proxy to the Harbor core/registry # If using Nginx as a proxy to the Harbor core/registry
proxy_buffer_size 16k; proxy_buffer_size 128k;
proxy_buffers 4 32k; proxy_buffers 4 256k;
proxy_busy_buffers_size 64k; proxy_busy_buffers_size 256k;
proxy_connect_timeout 300; proxy_connect_timeout 300;
proxy_send_timeout 300; proxy_send_timeout 300;