diff --git a/internal/mode/static/nginx/config/servers_template.go b/internal/mode/static/nginx/config/servers_template.go index 80b0847e2e..c3873ef105 100644 --- a/internal/mode/static/nginx/config/servers_template.go +++ b/internal/mode/static/nginx/config/servers_template.go @@ -149,10 +149,10 @@ server { {{- end }} {{ end }} server { - listen unix:/var/run/nginx/nginx-502-server.sock; + listen unix:/var/run/nginx/nginx-503-server.sock; access_log off; - return 502; + return 503; } server { diff --git a/internal/mode/static/nginx/config/upstreams.go b/internal/mode/static/nginx/config/upstreams.go index da52beb07c..88c66c47fd 100644 --- a/internal/mode/static/nginx/config/upstreams.go +++ b/internal/mode/static/nginx/config/upstreams.go @@ -13,8 +13,8 @@ import ( var upstreamsTemplate = gotemplate.Must(gotemplate.New("upstreams").Parse(upstreamsTemplateText)) const ( - // nginx502Server is used as a backend for services that cannot be resolved (have no IP address). - nginx502Server = "unix:/var/run/nginx/nginx-502-server.sock" + // nginx503Server is used as a backend for services that cannot be resolved (have no IP address). + nginx503Server = "unix:/var/run/nginx/nginx-503-server.sock" // nginx500Server is used as a server for the invalid backend ref upstream. nginx500Server = "unix:/var/run/nginx/nginx-500-server.sock" // invalidBackendRef is used as an upstream name for invalid backend references. @@ -112,7 +112,7 @@ func (g GeneratorImpl) createUpstream(up dataplane.Upstream) http.Upstream { ZoneSize: zoneSize, Servers: []http.UpstreamServer{ { - Address: nginx502Server, + Address: nginx503Server, }, }, } diff --git a/internal/mode/static/nginx/config/upstreams_test.go b/internal/mode/static/nginx/config/upstreams_test.go index b3f8d16981..5b3a8268a3 100644 --- a/internal/mode/static/nginx/config/upstreams_test.go +++ b/internal/mode/static/nginx/config/upstreams_test.go @@ -58,7 +58,7 @@ func TestExecuteUpstreams(t *testing.T) { "server 10.0.0.0:80;", "server 11.0.0.0:80;", "server [2001:db8::1]:80", - "server unix:/var/run/nginx/nginx-502-server.sock;", + "server unix:/var/run/nginx/nginx-503-server.sock;", } upstreamResults := gen.executeUpstreams(dataplane.Configuration{Upstreams: stateUpstreams}) @@ -148,7 +148,7 @@ func TestCreateUpstreams(t *testing.T) { ZoneSize: ossZoneSize, Servers: []http.UpstreamServer{ { - Address: nginx502Server, + Address: nginx503Server, }, }, }, @@ -194,7 +194,7 @@ func TestCreateUpstream(t *testing.T) { ZoneSize: ossZoneSize, Servers: []http.UpstreamServer{ { - Address: nginx502Server, + Address: nginx503Server, }, }, }, @@ -210,7 +210,7 @@ func TestCreateUpstream(t *testing.T) { ZoneSize: ossZoneSize, Servers: []http.UpstreamServer{ { - Address: nginx502Server, + Address: nginx503Server, }, }, }, diff --git a/site/content/how-to/monitoring/troubleshooting.md b/site/content/how-to/monitoring/troubleshooting.md index 5ef65d5958..c14d72ea83 100644 --- a/site/content/how-to/monitoring/troubleshooting.md +++ b/site/content/how-to/monitoring/troubleshooting.md @@ -139,7 +139,7 @@ You can see logs for a crashed or killed container by adding the `-p` flag to th Understanding the NGINX configuration is key for fixing issues because it shows how NGINX handles requests. This helps tweak settings to make sure NGINX behaves the way you want it to for your application. To see your current configuration, you can open a shell in the _nginx_ container by following these [steps](#get-shell-access-to-nginx-container) and run `nginx -T`. To understand the usage of NGINX directives in the configuration file, consult this list of [NGINX directives](https://nginx.org/en/docs/dirindex.html). In this section, we will see how the configuration gets updated as we configure different Services, Deployments and HTTPRoutes with NGINX Gateway Fabric. In the configuration file, you'll often find several server blocks, each assigned to specific ports and server names. NGINX selects the appropriate server for a request and evaluates the URI against the location directives within that block. -When only a Gateway resource is defined, but no Services or HTTPRoutes are configured, NGINX generates a basic configuration. This includes a default server listening on the ports specified in the Gateway listeners, handling all incoming requests. Additionally, there are blocks to manage errors with status codes 500 or 502. +When only a Gateway resource is defined, but no Services or HTTPRoutes are configured, NGINX generates a basic configuration. This includes a default server listening on the ports specified in the Gateway listeners, handling all incoming requests. Additionally, there are blocks to manage errors with status codes 500 or 503. This is a default `server` block listening on port 80: