ingress/controllers/nginx: WebSocket documentation
For those that do not understand the default way in which nginx proxies requests not containing a "Connection" header, the approach for enabling WebSocket support might not make sense. This commit adds documentation that explains why things are done this way.
This commit is contained in:
parent
90d8402293
commit
0373ce6f31
1 changed files with 7 additions and 0 deletions
|
@ -92,6 +92,13 @@ http {
|
|||
resolver {{ .defResolver }} valid=30s;
|
||||
{{ end }}
|
||||
|
||||
{{/* Whenever nginx proxies a request without a "Connection" header, the "Connection" header is set to "close" */}}
|
||||
{{/* when making the target request. This means that you cannot simply use */}}
|
||||
{{/* "proxy_set_header Connection $http_connection" for WebSocket support because in this case, the */}}
|
||||
{{/* "Connection" header would be set to "" whenever the original request did not have a "Connection" header, */}}
|
||||
{{/* which would mean no "Connection" header would be in the target request. Since this would deviate from */}}
|
||||
{{/* normal nginx behavior we have to use this approach. */}}
|
||||
# Retain the default nginx handling of requests without a "Connection" header
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
|
|
Loading…
Reference in a new issue