<p>I would suggest to use Ubuntu form docker hub and try Ubuntu alpine image.</p>

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

CC BY-SA 4.0
2019-02-06T05:49:59.607Z
2019-02-06T05:49:59.607Z
Harsh Manvar
<p>What I have created is:</p>

<p>I have a Docker container that is published the port "3000:3000".</p>

<p>If I'm accessing the container in this way: <a href="http://example.com:3000" rel="nofollow noreferrer">http://example.com:3000</a> everything is working great.</p>

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

<pre><code>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 "";
    }
}
</code></pre>

<p>Now, if I want to access my container via <a href="http://example.com" rel="nofollow noreferrer">http://example.com</a> (without to tell the port 3000) the network/connection/speed is incredible slow.</p>

<p>Had someone this issue before?
What can I do to solve the issue?</p>

<p>In Nginx I'm seeing errors like this:</p>

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

<p>Regards,</p>

<blockquote>
  <p>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).</p>
</blockquote>

CC BY-SA 4.0
2019-02-05T15:20:02.157Z
It was from nginx from CentOS7 ... tried with Ubuntu 18.04 and works as expected
biTc0d
<docker><nginx>
Very slow network when serve container content via Nginx after published Docker port
biTc0d
# Very slow network when serve container content via Nginx after published Docker port

(Asked by: username_0 on 2019-02-04)

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:

Regards,

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

**Tags:** docker, nginx

> **Comments:**
> **username_0**: It was from nginx from CentOS7 ... tried with Ubuntu 18.04 and works as expected  

---

## 1 answers

### Answer by username_1 on 2019-02-06. Score: 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


---

