@@ -112,6 +112,8 @@ func (cnf *Configurator) generateNginxCfg(ingEx *IngressEx, pems map[string]stri
112
112
RealIPHeader : ingCfg .RealIPHeader ,
113
113
SetRealIPFrom : ingCfg .SetRealIPFrom ,
114
114
RealIPRecursive : ingCfg .RealIPRecursive ,
115
+ ProxyHideHeaders : ingCfg .ProxyHideHeaders ,
116
+ ProxyPassHeaders : ingCfg .ProxyPassHeaders ,
115
117
}
116
118
117
119
if pemFile , ok := pems [serverName ]; ok {
@@ -160,6 +162,8 @@ func (cnf *Configurator) generateNginxCfg(ingEx *IngressEx, pems map[string]stri
160
162
RealIPHeader : ingCfg .RealIPHeader ,
161
163
SetRealIPFrom : ingCfg .SetRealIPFrom ,
162
164
RealIPRecursive : ingCfg .RealIPRecursive ,
165
+ ProxyHideHeaders : ingCfg .ProxyHideHeaders ,
166
+ ProxyPassHeaders : ingCfg .ProxyPassHeaders ,
163
167
}
164
168
165
169
if pemFile , ok := pems [emptyHost ]; ok {
@@ -190,6 +194,20 @@ func (cnf *Configurator) createConfig(ingEx *IngressEx) Config {
190
194
if proxyReadTimeout , exists := ingEx .Ingress .Annotations ["nginx.org/proxy-read-timeout" ]; exists {
191
195
ingCfg .ProxyReadTimeout = proxyReadTimeout
192
196
}
197
+ if proxyHideHeaders , exists , err := GetMapKeyAsStringSlice (ingEx .Ingress .Annotations , "nginx.org/proxy-hide-headers" , ingEx .Ingress ); exists {
198
+ if err != nil {
199
+ glog .Error (err )
200
+ } else {
201
+ ingCfg .ProxyHideHeaders = proxyHideHeaders
202
+ }
203
+ }
204
+ if proxyPassHeaders , exists , err := GetMapKeyAsStringSlice (ingEx .Ingress .Annotations , "nginx.org/proxy-pass-headers" , ingEx .Ingress ); exists {
205
+ if err != nil {
206
+ glog .Error (err )
207
+ } else {
208
+ ingCfg .ProxyPassHeaders = proxyPassHeaders
209
+ }
210
+ }
193
211
if clientMaxBodySize , exists := ingEx .Ingress .Annotations ["nginx.org/client-max-body-size" ]; exists {
194
212
ingCfg .ClientMaxBodySize = clientMaxBodySize
195
213
}
0 commit comments