task definition has the option to add systemControls which will be passed as sysctl options to containers.
it is especially helpful where you want to overwrite max_connections for having more Nginx works.
More info:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-systemcontrol.html