diff --git a/application/backend-monorepo-multiservice/server-config/nginx.conf b/application/backend-monorepo-multiservice/server-config/nginx.conf index 2d63e695..4240ed16 100644 --- a/application/backend-monorepo-multiservice/server-config/nginx.conf +++ b/application/backend-monorepo-multiservice/server-config/nginx.conf @@ -13,17 +13,17 @@ http { sendfile on; keepalive_timeout 65; - - # Access and error logs are sent to stdout and stderr - access_log /dev/stdout main; - error_log /dev/stderr warn; - + # Custom log format to log both REMOTE_ADDR and X-Forwarded-For log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" - "$http_x_forwarded_for" - ' '"$http_x_real_ip" - "$http_x_google_real_ip"'; + # Access and error logs are sent to stdout and stderr + access_log /dev/stdout main; + error_log /dev/stderr warn; + # Set trusted Cloud Run proxy IP ranges set_real_ip_from 0.0.0.0/0; # All IP ranges, or specific trusted ranges can be used real_ip_header X-Forwarded-For;