Here’s a step-by-step guide to deploying Node.js directly to IIS without using URL rewriting:
1. Install IIS
If IIS is not already installed on your server, you need to install it:
- Open the Server Manager.
- Select Add Roles and Features.
- Choose Web Server (IIS) and complete the installation.
2. Install iisnode
iisnode is a module that enables hosting Node.js applications in IIS.
- Download and install the latest version of iisnode from the official repository: iisnode GitHub Releases.
- Run the installer to integrate iisnode with your IIS server.
3. Set Up Your Node.js Application
- Prepare Your Application: Ensure your Node.js application has an
app.js
orserver.js
file as the main entry point. - Create a Web Application in IIS:
- Open IIS Manager.
- Right-click on Sites in the left-hand panel and choose Add Website.
- Specify the Site name, Physical path (where your Node.js app resides), and a Port or Host name.
- Make sure to set the Physical path to the directory containing your Node.js application.
- Configure the Web.config File: To run your Node.js app without URL rewriting, you need a
web.config
file in your application directory. This file will instruct IIS to use iisnode to serve your application.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.