Closed jmajonis closed 4 years ago
Thank you for your excellent collection of cfn-modules repositories. I am very new to CloudFormation and ECS and it's been a great help seeing complex examples of CloudFormation templates working together and following best practices.
I am trying to implement the fargate proxy pattern described here: https://github.com/cfn-modules/docs/blob/master/examples/fargate-alb-proxy-pattern/example.yml
Where the proxy is Nginx relaying port 80 from the ALB to port 3000 on the app container.
Can you please point in the direction of a suitable nginx.conf configuration for this arrangement?
I have tried in nginx.conf
upstream rails_app { server app:3000; }
resulting in error
nginx: [emerg] host not found in upstream "app:3000" in /etc/nginx/conf.d/default.conf:3
I don't understand how to represent Fargate awsvpc networked containers in the nginx.conf file. Any help would be appreciated. Thank you.
Hi @jmajonis
use localhost, not app and you should be fine.
localhost
app
Let me know if it works.
@michaelwittig yes, that worked, thank you!
Thank you for your excellent collection of cfn-modules repositories. I am very new to CloudFormation and ECS and it's been a great help seeing complex examples of CloudFormation templates working together and following best practices.
I am trying to implement the fargate proxy pattern described here: https://github.com/cfn-modules/docs/blob/master/examples/fargate-alb-proxy-pattern/example.yml
Where the proxy is Nginx relaying port 80 from the ALB to port 3000 on the app container.
Can you please point in the direction of a suitable nginx.conf configuration for this arrangement?
I have tried in nginx.conf
upstream rails_app { server app:3000; }
resulting in error
nginx: [emerg] host not found in upstream "app:3000" in /etc/nginx/conf.d/default.conf:3
I don't understand how to represent Fargate awsvpc networked containers in the nginx.conf file. Any help would be appreciated. Thank you.