No, aws doesn't expose port when running docker. But it uses port information from the container to create an upstream on nginx config.
/etc/nginx/conf.d/elasticbeanstalk-nginx-docker-upstream.conf
upstream docker {
server 172.17.0.33:24224;
keepalive 256;
}
Then another file to do reverse-proxy
/etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy.conf
map $http_upgrade $connection_upgrade {
default "upgrade";
"" "";
}
server {
listen 24224;
location / {
proxy_pass http://docker;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
I think we need to remove http
from that proxy_pass
line.
I'll post an update when it works.
PS:
Let me know if trying to run fluentd on EB is not a futile effort.
Update:
I managed to make it works!