 
   locations = ""
   for name, options of workers when options.ports?
-
     # don't add those who whish not to be generated, probably because those are
     # using manually written locations
     continue if options.nginx?.disableLocation?

      }
  \n"""

createWebsocketLocation = (name, location) ->
  return """\n
      location #{location} {
        proxy_pass            http://#{name};

        # needed for websocket handshake
        proxy_http_version    1.1;

auth_basic            "Restricted";
      auth_basic_user_file  /etc/nginx/conf.d/.htpasswd;"""

createWebLocation = ({name, location, auth, proxyPass}) ->
  auth ?= no
  return """\n
      location #{location} {
        proxy_pass            #{proxyPass};
        proxy_set_header      X-Real-IP       $remote_addr;
        proxy_set_header      X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_next_upstream   error timeout   invalid_header http_500;
