iisdeploymentremix.runwindows-server-2022

How to deploy react Remix framework to IIS on windows server 2022?


I developed an App on REMIX framework. But ı do not know how will i publish it on IIS server on Windows Server 2022. Which opitons should selected for IIS.

 npx create-remix@latest
 ? Where would you like to create your app? (./my-remix-app)
 ? Where do you want to deploy? Choose Remix if you're unsure, it's easy to change deployment targets. (Use arrow keys)
❯ Remix App Server
? TypeScript or JavaScript? (Use arrow keys)
❯ TypeScript

Solution

  • Thanks for answers which showed me a way for found a solition.

    1. Install Node.js on Windows Server .

    2. Install IIS Node on Windows Server.

    3. Install URL Rewrite on Windows Server.

    4. Upload all files to under your web site folder on wwwroot except .cache,build,public/build,node_modules folders.(we will install them on server.)

    5. Under web site folder, type command on cmd npm install

    6. Type command npm run dev

    7. Create a web.config file main path of web site. Codes are :

      <?xml version="1.0" encoding="utf-8"?>
      <configuration> 
      <system.webServer>
      <iisnode loggingEnabled="false" nodeProcessCommandLine="C:\Program Files\nodejs\node.exe" />        
      <handlers>
      <add name="iisnode" path="/build/index.js" verb="*" modules="iisnode" />
      </handlers>  
      <security>
      <requestFiltering>
       <hiddenSegments>
         <add segment="node_modules" />
         <add segment="iisnode" />
       </hiddenSegments>
       </requestFiltering>
       </security>
       <rewrite>
          <rules>
              <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                  <match url="(.*)" />
                  <action type="Rewrite" url="http://localhost:3000/{R:1}" />
              </rule>
          </rules>
      </rewrite>
      </system.webServer> 
      </configuration>