How to check for the existence of a response header in Nginx rules?
I guess you want something like the following in a location
block:
if ($sent_http_content_length ~ '') {
more_clear_headers Content-Type
...
}
See $sent_http_name
(Disclaimer: I haven't tried this; I just dug through the docs because I found the question interesting. This may or may not work)