Hosting Nextjs app in IIS as sub Application under Website #57400
Unanswered
RichLearner
asked this question in
Help
Replies: 1 comment
-
Unverified, I don't know if this works? https://docs.lextudio.com/blog/running-next-js-web-apps-on-iis-with-httpplatformhandler/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I am trying to deploy my nextJs app to IIS. I have been testing and trying out ways to deploy but I never seem to get the issue behind. The issue is that the page loads however I encountered some errors where the console says "GET {website_url} 404 Not Found"
This is what my web.config looks like
<configuration> <system.webServer> <!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support --> <webSocket enabled="false" /> <handlers> <!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module --> <add name="iisnode" path="server.js" verb="*" modules="iisnode"/> </handlers> <rewrite> <rules> <!-- Do not interfere with requests for node-inspector debugging --> <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true"> <match url="^server.js\/debug[\/]?" /> </rule> <!-- First we consider whether the incoming URL matches a physical file in the /public folder --> <rule name="StaticContent"> <action type="Rewrite" url="public{REQUEST_URI}"/> </rule> <!-- All other URLs are mapped to the node.js site entry point --> <rule name="DynamicContent"> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/> </conditions> <action type="Rewrite" url="server.js"/> </rule> </rules> </rewrite> <!-- 'bin' directory has no special meaning in node.js and apps can be placed in it --> <security> <requestFiltering> <hiddenSegments> <add segment="node_modules"/> </hiddenSegments> </requestFiltering> </security> <!-- Make sure error responses are left untouched --> <httpErrors existingResponse="PassThrough" /> <iisnode node_env="production" /> <!-- You can control how Node is hosted within IIS using the following options: * watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server * node_env: will be propagated to node as NODE_ENV environment variable * debuggingEnabled - controls whether the built-in debugger is enabled See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options --> <!--<iisnode watchedFiles="web.config;*.js"/>--> </system.webServer> <appSettings> <add key="API_URL" value="http://192.168.0.18:91/json/Default.aspx" /> <add key="API_FOOD_URL" value="http://192.168.0.18:91/json/food_menu.aspx" /> <add key="NEXT_PUBLIC_API_CORS_URL" value="http://192.168.0.18:91/json/Default.aspx" /> <add key="NEXT_PUBLIC_API_FOOD_CORS_URL" value="http://192.168.0.18:91/json/food_menu.aspx" /> <add key="NEXT_PUBLIC_API_URL" value="http://192.168.0.18:91/json/Default.aspx" /> <add key="NEXT_PUBLIC_API_FOOD_URL" value="http://192.168.0.18:91/json/food_menu.aspx" /> </appSettings> </configuration>
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions