I am trying to return a 415 error when the content_type is not application/json using Nginx which means I need to allow all traffic which is of content_type application/json using maps I have achieved the below
map $content_type $ct_check{
"application/json" 'pass';
~*(.*)'failed';
default 'pass';
However my end customers sends multiple content type like application/json;charset-utf8 something like this so I need to have a regex to allow all the content_types starting with application/json tried multiple combinations but no luck