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