1

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:

  1. 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.

  2. 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.

  3. 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.

  • What is the purpose of the reverse proxy here? – kaizenCoder Jun 23 at 10:19
  • We use an Nginx pod to reverse proxy instead of Nginx Ingress because we have the need to use the nginx.conf file. If we used Nginx Ingress, there's no nginx.conf and we're afraid there may be configurations that are not fully supported. – Tran Triet Jun 26 at 7:12
0

All cookies and headers are a construct of the HTTP protocol. Kubernetes Services operate on TCP/UDP packets therefore it will pass the payload as-is.

It is not that there isn't an nginx.conf file but rather the configuration is managed via annotations. See this link https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.