The map directive is valid only in the http context: Module ngx_http_map_module
The Additional nginx directives are included in the server context which is within the http context.
In order to set map directive, create a .conf file in /etc/nginx/conf.d/