File tree 4 files changed +23
-2
lines changed 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 82
82
volumes :
83
83
- name : nginx-config
84
84
emptyDir : { }
85
+ - name : var-lib-nginx
86
+ emptyDir : { }
85
87
- name : njs-modules
86
88
configMap :
87
89
name : njs-modules
92
94
volumeMounts :
93
95
- name : nginx-config
94
96
mountPath : /etc/nginx
97
+ - name : var-lib-nginx
98
+ mountPath : /var/lib/nginx
95
99
containers :
96
100
- image : ghcr.io/nginxinc/nginx-kubernetes-gateway:edge
97
101
imagePullPolicy : Always
@@ -118,5 +122,7 @@ spec:
118
122
volumeMounts :
119
123
- name : nginx-config
120
124
mountPath : /etc/nginx
125
+ - name : var-lib-nginx
126
+ mountPath : /var/lib/nginx
121
127
- name : njs-modules
122
128
mountPath : /usr/lib/nginx/modules/njs
Original file line number Diff line number Diff line change @@ -53,4 +53,17 @@ server {
53
53
}
54
54
{{ end }}
55
55
{{ end }}
56
+ server {
57
+ listen unix:/var/lib/nginx/nginx-502-server.sock;
58
+ access_log off;
59
+
60
+ return 502;
61
+ }
62
+
63
+ server {
64
+ listen unix:/var/lib/nginx/nginx-500-server.sock;
65
+ access_log off;
66
+
67
+ return 500;
68
+ }
56
69
`
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import (
11
11
const (
12
12
// nginx502Server is used as a backend for services that cannot be resolved (have no IP address).
13
13
nginx502Server = "unix:/var/lib/nginx/nginx-502-server.sock"
14
+ // nginx500Server is used as a server for the invalid backend ref upstream.
15
+ nginx500Server = "unix:/var/lib/nginx/nginx-500-server.sock"
14
16
// invalidBackendRef is used as an upstream name for invalid backend references.
15
17
invalidBackendRef = "invalid-backend-ref"
16
18
)
@@ -65,7 +67,7 @@ func createInvalidBackendRefUpstream() http.Upstream {
65
67
Name : invalidBackendRef ,
66
68
Servers : []http.UpstreamServer {
67
69
{
68
- Address : nginx502Server ,
70
+ Address : nginx500Server ,
69
71
},
70
72
},
71
73
}
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ func TestCreateUpstreams(t *testing.T) {
128
128
Name : invalidBackendRef ,
129
129
Servers : []http.UpstreamServer {
130
130
{
131
- Address : nginx502Server ,
131
+ Address : nginx500Server ,
132
132
},
133
133
},
134
134
},
You can’t perform that action at this time.
0 commit comments