         deny                  all;
 """
 
-createWebLocation = ({name, locationConf}) ->
+createWebLocation = ({name, locationConf, cors}) ->
   { location, proxyPass, internalOnly, auth, extraParams } = locationConf
     # 3 tabs are just for style
   extraParamsStr = extraParams?.join("\n\t\t\t") or ""
   host = locationConf.host or "$host"
+
   return """\n
       location #{location} {
         proxy_pass            #{proxyPass};

fs                     = require 'fs'
{ isAllowed, isProxy } = require './grouptoenvmapping'

createUpstreams = (KONFIG) ->


      else
        auth = options.nginx.auth

      if location.cors
        cors = """
        if ($http_origin ~* (.*\.)*#{_.escapeRegExp KONFIG.domains.main}) {
                add_header Access-Control-Allow-Origin $http_origin always;
              }
        """

      locations += fn {name, locationConf: location, auth, cors}

  return locations

