upstream {{ name }}_backend {
  server {{ www.address }}:{{ www.port }};
}


server {
 listen 80;
 server_name {{ module['rw.www'].domain }};

 location / {
   proxy_pass        http://{{ name }}_backend;
   proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header Host $host;
#   proxy_http_version 1.1;
   proxy_set_header Connection "";

   gzip             on;
   gzip_min_length  1000;
   gzip_proxied     expired no-cache no-store private auth;
   gzip_types       text/plain application/xml text/css application/javascript;
   gzip_disable     "MSIE [1-6]\.";
 }
}



{% if nginx_config.aliases %}
server {
 listen 80;
 server_name {{ nginx_config.aliases }};

 rewrite     ^ {{ module['rw.www'].domain }}$request_uri? permanent;
}
{% endif %}

{{ nginx_config.append }}