$http_name_of_the_header_key
i.e if you have origin = domain.com
in header, you can use $http_origin
to get "domain.com"
In nginx does support arbitrary request header field. In the above example last part of a variable name is the field name converted to lower case with dashes replaced by underscores
Reference doc here: http://nginx.org/en/docs/http/ngx_http_core_module.html#var_http_
For your example the variable would be $http_my_custom_header
.