Skip to content

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

@mheidari988

Description

@mheidari988

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions