I'm using Docker in AWS ECS. I have one EC2 machine with docker agent from AWS ECS, and the ECS task contains of 3 containers:
- nginx container
- application-nodejs container
- staticfiles-nodejs-application container.
I want to support very huge traffic. Do I need to setup AWSLoad Balancer? or my setting for nginx upstream is enough?
nginx conf example:
upstream appwww {
server app-www:3000;
}
server {
server_name my.home.net;
location / {
proxy_pass http://appwww;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
listen 443 ssl http2; # managed by Certbot
ssl_certificate......; # managed by Certbot
ssl_certificate_key........ # managed by Certbot
include /.......# managed by Certbot
ssl_dhparam /.....pem; # managed by Certbot
}
server {
if ($host = my.host.net) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name my.host.net;
return 404; # managed by Certbot
}