首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在iis和windows azure上运行高速公路4的内部错误

在iis和windows azure上运行高速公路4的内部错误
EN

Stack Overflow用户
提问于 2016-02-04 16:27:09
回答 1查看 696关注 0票数 0

我有基本的快递4应用程序运行在本地使用节点提供的web服务器。

我试图查看/编辑view矩阵并使用IIS,这样我就可以将其作为一个节点应用程序上传到Azure。Azure的模板使用了较早版本的节点和表达式。

当使用IIS从When矩阵运行时,当发布到Azure时,我会收到以下信息:

代码语言:javascript
运行
复制
HRESULT: 0x2
HTTP status: 500
HTTP reason: Internal Server Error

我相信这个问题在某种程度上与web.config文件有关,但是我发现的所有文章和修复都是过时的,而且还没有解决这个问题。

我的web.config文件:

代码语言:javascript
运行
复制
<configuration>
<system.webServer>

<handlers>
  <!-- indicates that the app.js file is a node.js application to be handled by the iisnode module -->
  <add name="iisnode" path="app.js" verb="*" modules="iisnode" />
</handlers>

<rewrite>
  <rules>

    <!-- Don't interfere with requests for node-inspector debugging -->
    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^app.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 application entry point -->
    <rule name="DynamicContent">
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True" />
      </conditions>
      <action type="Rewrite" url="app.js" />
    </rule>
  </rules>
</rewrite>

<!-- You can control how Node is hosted within IIS using the following options -->
<!--
  <iisnode      
      node_env="%node_env%"
      nodeProcessCountPerApplication="1"
      maxConcurrentRequestsPerProcess="1024"
      maxNamedPipeConnectionRetry="3"
      namedPipeConnectionRetryDelay="2000"      
      maxNamedPipeConnectionPoolSize="512"
      maxNamedPipePooledConnectionAge="30000"
      asyncCompletionThreadCount="0"
      initialRequestBufferSize="4096"
      maxRequestBufferSize="65536"
      watchedFiles="*.js"
      uncFileChangesPollingInterval="5000"      
      gracefulShutdownTimeout="60000"
      loggingEnabled="true"
      logDirectoryNameSuffix="logs"
      debuggingEnabled="true"
      debuggerPortRange="5058-6058"
      debuggerPathSegment="debug"
      maxLogFileSizeInKB="128"
      appendToExistingLog="false"
      logFileFlushInterval="5000"
      devErrorsEnabled="true"
      flushResponse="false"      
      enableXFF="false"
      promoteServerVars=""
    />
  -->


</system.webServer>
</configuration>

我已经联系了Azure团队,他们已经开始了一场讨论,但我对堆叠溢出用户可以提供什么更有信心。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-05 00:16:37

@Matthew,

下面是我的猜测,我认为在部署到azure应用程序服务时,您没有配置您的应用程序来监听正确的端口。您需要执行类似于以下代码的操作,才能从环境验证的"process.env.port“中获得端口号。

代码语言:javascript
运行
复制
var app = require('express')();
var port = process.env.port || 8080; // 8080 for local or whatever number u want
var listener = app.listen(port, function(){
    console.log('Listening on port ' + port); 
});
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35206327

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档