kubernetes / ingress-nginx

Ingress NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
17.36k stars 8.23k forks source link

Custom-error-pages image does not work with media content #11029

Open mdanylyuk opened 7 months ago

mdanylyuk commented 7 months ago

What happened: I built a custom-error-pages docker image that contains my pages with media content, e.g. png/jpg images. Then I tried to deploy it as the default backend.

But when I try to open this error page I don't see my images on the page, eg. icon/backgroud. And as I understand it's because Nginx set Content-Type header text/html for everything.

2024/02/27 11:32:08 serving custom error response for code 404 and format text/html from file /www/404.html
2024/02/27 11:32:28 format not specified. Using text/html
2024/02/27 11:32:28 serving custom error response for code 503 and format text/html from file /www/503.html
2024/02/27 11:32:29 format not specified. Using text/html

What you expected to happen: Ingress controller has to open my error page with all media content.

Ingress Controller returns, or does not return, X-Format header to the default-backend here

NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):

v1.9.4

Kubernetes version (use kubectl version):

Server Version: v1.27.7

Environment:

How to reproduce this issue:

Anything else we need to know:

longwuyuan commented 7 months ago

/triage accepted /help

k8s-ci-robot commented 7 months ago

@longwuyuan: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to [this](https://github.com/kubernetes/ingress-nginx/issues/11029): >/triage accepted >/help Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
github-actions[bot] commented 6 months ago

This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach #ingress-nginx-dev on Kubernetes Slack.