Created
January 15, 2019 06:51
-
-
Save Abhinay-g/be959d6f1fb6dfe86536be49e6d46835 to your computer and use it in GitHub Desktop.
Host Node JS on IIS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install IISNODE and URLrewrite | |
run setupsamples.bat from iisnode folder inside programfiles/iisnode | |
open IIS then goto default website >> browse localhost:8080 you can see multiple links | |
open link , if erro then got to IIS root > goto Feature Delegation > change setting for Handler Mapping | |
All set | |
now goto inetpub > wwwroot > create folder for NodeJS code > goto security folder properties and add user IIS_IUSRS > give all permissions | |
goto IIS and add a website, set physical path to folder careted in above step. | |
create a web.config file and place it into forder created in wwwroot | |
webconfig content | |
======================================================================= | |
<configuration> | |
<system.webServer> | |
<handlers> | |
<add name="iisnode" path="www.js" verb="*" modules="iisnode" resourceType="Unspecified" requireAccess="Script" /> | |
</handlers> | |
<rewrite> | |
<rules> | |
<rule name="simplenode" stopProcessing="true"> | |
<match url="/*" /> | |
<action type="Rewrite" url="www.js" /> | |
</rule> | |
</rules> | |
</rewrite> | |
</system.webServer> | |
</configuration> | |
============================================================================ | |
goto firewall and add inbound to the port specefied for node website | |
todo azure networking and add an inbound port | |
browse: localhost:port/foldername/api_path | |
browse: 52.229.8.80:port/foldername/api_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment