Can I affect the mime type for a return in nginx-ingress?

Viewed 292

For a K8S nginx ingress, is there a way to set the mime type for a return without defining custom locations?

This does not work

nginx.ingress.kubernetes.io/server-snippet: |
  if ($ssl_client_escaped_cert = "") {
    default_type application/problem+json;
    return 401 '{"type"="https://namespace/problems#unauthorized", "title"="Client certificate required"}';
  }

This works, but content type is text

nginx.ingress.kubernetes.io/server-snippet: |
  if ($ssl_client_escaped_cert = "") {
    return 401 '{"type"="https://namespace/problems#unauthorized", "title"="Client certificate required"}';
  }
0 Answers
Related