8000 Add Web Application Manifest MIME type by vitalyster · Pull Request #137 · nginx/nginx · GitHub
[go: up one dir, main page]

Skip to content

Add Web Application Manifest MIME type #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

vitalyster
Copy link

Copy link
@rginbox rginbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@viktorberezikov
Copy link
Member

The purpose of the conf/mime.types example configuration is to instruct nginx that it should automatically apply the specific Content-Type header based on the file extension when it sends local files. To be clear, it does not work for proxied responses.

Regarding the fundamental increasing of the MIME types list. It seems that extensions of this example should be reasonable. In addition to existing in IANA media types should be supported by popular clients/browsers. Randomly adding rare and ambiguous MIME types does not look useful. At the same time, specific needs/types can always be configured based on the example.

As for the current pull request. It looks like this MIME type is not well supported by clients/browsers. Could you please clarify the reasons why the application/manifest+json MIME type should be added to the conf/mime.types file? In addition to the mention in IANA media types.

@vitalyster
Copy link
Author
vitalyster commented Sep 11, 2024

@viktorberezikov this MIME type is fully supported by any modern web browser and it is an important part of any Web App. When app manifest is served with incorrect MIME type browser may not recognize Web App correctly and will not display "Install Web App..." UI prompts, may not enable "standalone" mode without browser chrome, may not display correct icons, etc. Anyone who serve web apps on Nginx should add that MIME type, so it would be great if this MIME type will be present by default.

@viktorberezikov
Copy link
Member

Dear @vitalyster,
As I mentioned earlier, the MIME types configuration affects the mapping of file extensions to the Content-Type header. And this is true only for files that nginx sends directly from the local storage. As I understand, you are describing a case where the backend application server provides the manifest to the browser. The example configuration file conf/mime.types does not affect proxied requests. These responses use the Content-Type header passed by the backend.
Just in case, about support. It looks like Chromium would recognize this extension without the header. But Firefox cannot support it at all.

@vitalyster
Copy link
Author

@viktorberezikov I'm describing Web App hosted on nginx as static files, without any backend. In this case nginx sets Content-Type header to this MIME type and it works in browsers.

@pluknet
Copy link
Contributor
pluknet commented Oct 25, 2024

I don't feel application/manifest+json is popular enough to be included.
If this will change in future, this PR can be reopened.

@pluknet pluknet closed this Oct 25, 2024
@jnoordsij
Copy link
jnoordsij commented Nov 17, 2024

Just wanted to chime in on this with noting that MDN actively recommends responding with this mimetype on .webmanifest files, referring to https://w3c.github.io/manifest/#media-type-registration, which in my eyes is a relevant enough source to considering implementing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0