Skip to main content

ContentType

The Content-Type middleware sets the Content-Type header value to the media type detected from the response content, when it is not set by the backend.

info

The scope of the Content-Type middleware is the MIME type detection done by the core of Traefik (the server part).
Therefore, it has no effect against any other Content-Type header modifications (e.g.: in another middleware such as compress).


Configuration Example

Enable auto-detection
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: autodetect
spec:
contentType: {}