Providers

IIS

将 Nitro 应用部署到 IIS。

使用
IISnode

¥Using IISnode

预设:iis_node

¥Preset: iis_node

  1. 在你的 Windows 服务器上安装 Node.js 的最新 LTS 版本。
  2. 安装 IISnode
  3. 安装 IIS URLRewrite 模块
  4. 在 IIS 中,将 .mjs 添加为新的 MIME 类型,并将其内容类型设置为 application/javascript
  5. .output 文件夹的内容部署到 IIS 中的网站。

使用 IIS 处理程序

¥Using IIS handler

预设:iis_handler / iis

¥Preset: iis_handler / iis

你可以直接使用 IIS http 处理程序。

¥You can use IIS http handler directly.

  1. 在你的 Windows 服务器上安装 Node.js 的最新 LTS 版本。
  2. 安装 IIS HttpPlatformHandler 模块
  3. 将你的 .output 目录复制到 Windows 服务器,并在 IIS 上创建一个指向该目录的网站。

IIS 配置选项

¥IIS config options

export default defineNitroConfig({
  // IIS options default
  iis: {
    // merges in a pre-existing web.config file to the nitro default file
    mergeConfig: true,
    // overrides the default nitro web.config file all together
    overrideConfig: false,
  },
});