Skip to content
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

Global IIS MIME Type Configuration Not Applied When Using iisnode #138

Open
mheidari988 opened this issue Oct 27, 2023 · 0 comments
Open

Comments

@mheidari988
Copy link

Description:

I have encountered an issue where configuring the MIME type for .webp images at the global IIS level doesn't seem to apply when my application is running via iisnode. However, adding the MIME type configuration to the project's web.config file solves the problem.

Steps to Reproduce:

  1. Add .webp MIME type at the IIS server level.
  2. Deploy a Next.js application using iisnode.
  3. Try to access a .webp image through the browser.

Expected Behavior:

IIS should serve .webp images correctly based on the global MIME type configuration.

Actual Behavior:

IIS does not serve .webp images unless the MIME type is specified in the project's web.config file.

Workaround:

The issue can be resolved by adding the following to the web.config file within the project:

<system.webServer>
    <staticContent>
        <mimeMap fileExtension=".webp" mimeType="image/webp" />
    </staticContent>
</system.webServer>

Environment:
IIS version: 10.0.20348.1
iisnode version: 0.2.21
Next.js version: 13.5.6
Operating System: Windows Server 2022 Standard v10.0.20348 Build 20348

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

No branches or pull requests

1 participant