IIS
Deploy Nitro apps to IIS.
Using IISnode
Preset: iis_node
Install the latest LTS version of Node.js on your Windows Server.
Install IISnode
Install IIS URLRewrite Module.
In IIS, add .mjs as a new mime type and set its content type to application/javascript.
Deploy the contents of your .output folder to your website in IIS.
Using IIS handler
Preset: iis_handler
You can use the IIS HttpPlatformHandler directly.
Install the latest LTS version of Node.js on your Windows Server.
Install IIS HttpPlatformHandler Module
Copy your .output directory into the Windows Server, and create a website on IIS pointing to that exact directory.
IIS config options
nitro.config.ts
import { defineConfig } from "nitro";
export default defineConfig({
iis: {
// merge a pre-existing web.config file into the Nitro default file
mergeConfig: true,
// override the default Nitro web.config file altogether
overrideConfig: false,
},
});