We are going to be using several template files for our NGINX configuration. The first template is called roles/stack-config/templates/nginx-nginx.conf.j2, and it will replace the main NGINX configuration deployed by the package installation:
# {{ ansible_managed }}user nginx;worker_processes {{ ansible_processor_count }};error_log /var/log/nginx/error.log warn;pid /var/run/nginx.pid;events { worker_connections 1024;}http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout ...