Report from Stack Overflow due to off-topic
Base knowlege
Since this question deals particularly with various timeouts configuration in Nginx
, I thought giving their references here would make it easier for everyone to help me. These are Nginx
time out directives I use:
proxy_connect_timeout: Defines a timeout for establishing a connection with a proxied server. It should be noted that this timeout cannot usually exceed 75 seconds.
proxy_read_timeout
: Defines a timeout for reading a response from the proxied server. The timeout is set only between two successive read operations, not for the transmission of the whole response. If the proxied server does not transmit anything within this time, the connection is closed.proxy_send_timeout
: Sets a timeout for transmitting a request to the proxied server. The timeout is set only between two successive write operations, not for the transmission of the whole request. If the proxied server does not receive anything within this time, the connection is closed.
Scenario
Machine from Internet (A) – opens HTTP connection – > NginxPod (B) – reverses proxy – > a ClusterIP service (C).
location /abc {
proxy_pass http://service1.test.svc.cluster.local:3000;
# This is a dns name given to a `ClusterIP` service by K8s.
proxy_connect_timeout 2m;
proxy_read_timeout 60m;
send_timeout 60m;
}
K8s will do some magic internally (e.g. load balancing my requests to specific pods which are serving the service1).
Because there's another layer of load balancing imposed by K8s which I'm not in charged of, I wonder if my timeout settings for Nginx
will be honored by K8s.
nginx.conf
file. If we used Nginx Ingress, there's nonginx.conf
and we're afraid there may be configurations that are not fully supported.