What I have created is:

I have a Docker container that is published the port "3000:3000".

If I'm accessing the container in this way: http://example.com:3000 everything is working great.

The problem appears when I install on example.com server (CentOS7) Nginx. I configured Nginx in this way:

server {
    listen 80;

    root /opt/;
    index index.php index.html index.htm;

    server_name example.com;

    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_pass http://localhost:3000;
        proxy_set_header X-Host $http_host;
        proxy_http_version 1.1;
        proxy_set_header Connection "";

Now, if I want to access my container via http://example.com (without to tell the port 3000) the network/connection/speed is incredible slow.

Had someone this issue before? What can I do to solve the issue?

In Nginx I'm seeing errors like this:

 2019/02/04 11:53:18 [error] 8667#0: *289 upstream timed out (110: Connection timed out) while reading response header from upstream, client:


EDIT: I want to specify that the app is in replicas mode and I have 3 replicas (and 3 servers; one replica/app with port 3000 published for each server).

  • It was from nginx from CentOS7 ... tried with Ubuntu 18.04 and works as expected
    – biTc0d
    Feb 5, 2019 at 15:20

1 Answer 1


I would suggest to use Ubuntu form docker hub and try Ubuntu alpine image.

there should be also problem form database if your database is outside the K8s cluster so may possible latency problem should be there

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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