gpt4 book ai didi

node.js - 未显示 Azure Web App/虚拟目录上的 Node 应用程序

转载 作者:行者123 更新时间:2023-12-02 23:06:20 29 4
gpt4 key购买 nike

我已经找到一篇文章,但没有与当前 Azure Web App 配置选项匹配的文章。我想新版本中有些东西发生了变化。我正在尝试使用 Linux 应用服务计划通过 Azure Web 应用托管 Node 应用程序。

我的问题是,我的 Node 应用程序的内容没有显示。仅显示 Azure 启动页面。我猜想找不到完全存在于 site/wwwroot 中的内容。因此我想配置虚拟目录。此选项在我的 Azure 门户中不再可见?

enter image description here

然后,我通过 Azure ARM 模板自动化部署,并在其中添加了我的虚拟目录。部署运行没有问题。该配置在通过 Azure 门户生成的模板中也可见,但在上面的屏幕截图中看不到。

        {
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[parameters('sites__name')]",
"location": "West Europe",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_asp_name'))]"
],
"kind": "app,linux",
"properties": {
"enabled": true,
"hostNameSslStates": [
{
"name": "[concat(parameters('sites_name'), '.azurewebsites.net')]",
"sslState": "Disabled",
"hostType": "Standard"
},
{
"name": "[concat(parameters('sites_name'), '.scm.azurewebsites.net')]",
"sslState": "Disabled",
"hostType": "Repository"
}
],
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_asp_name'))]",
"reserved": true,
"isXenon": false,
"hyperV": false,
"siteConfig": {},
"scmSiteAlsoStopped": false,
"clientAffinityEnabled": true,
"clientCertEnabled": false,
"hostNamesDisabled": false,
"containerSize": 0,
"dailyMemoryTimeQuota": 0,
"httpsOnly": true,
"redundancyMode": "None"
}
},
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2018-11-01",
"name": "[concat(parameters('sites_name'), '/web')]",
"location": "West Europe",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_name'))]"
],
"properties": {
"numberOfWorkers": 1,
"defaultDocuments": [
"Default.htm",
"Default.html",
"Default.asp",
"index.htm",
"index.html",
"iisstart.htm",
"default.aspx",
"index.php",
"hostingstart.html"
],
"netFrameworkVersion": "v4.0",
"linuxFxVersion": "NODE|12-lts",
"requestTracingEnabled": false,
"remoteDebuggingEnabled": false,
"remoteDebuggingVersion": "VS2019",
"httpLoggingEnabled": false,
"logsDirectorySizeLimit": 35,
"detailedErrorLoggingEnabled": false,
"publishingUsername": "$myuser",
"scmType": "VSTSRM",
"use32BitWorkerProcess": true,
"webSocketsEnabled": false,
"alwaysOn": false,
"managedPipelineMode": "Integrated",
"virtualApplications": [
{
"virtualPath": "/",
"physicalPath": "site\\wwwroot",
"preloadEnabled": false
}
],
"loadBalancing": "LeastRequests",
"experiments": {
"rampUpRules": []
},
"autoHealEnabled": false,
"localMySqlEnabled": false,
"ipSecurityRestrictions": [
{
"ipAddress": "Any",
"action": "Allow",
"priority": 1,
"name": "Allow all",
"description": "Allow all access"
}
],
"scmIpSecurityRestrictions": [
{
"ipAddress": "Any",
"action": "Allow",
"priority": 1,
"name": "Allow all",
"description": "Allow all access"
}
],
"scmIpSecurityRestrictionsUseMain": false,
"http20Enabled": false,
"minTlsVersion": "1.2",
"ftpsState": "AllAllowed",
"reservedInstanceCount": 0
}
},

我通过Kudu检查了Azure Web App,像index.html这样的文件存在于site/wwwroot中。Azure Web App 有一个基本目录 /home,里面是 site/wwwroot。如何配置虚拟目录?我的错在哪里?

非常感谢。

最佳答案

Linux 应用服务上虚拟目录的配置方式与 Windows 应用服务上的虚拟目录配置方式不同。

Windows 应用服务的虚拟目录配置直接映射到 IIS 的虚拟目录功能,因为该平台上的所有网站均由 IIS 托管。在 Linux 应用服务上,您可以自由使用您喜欢的任何 Web 服务器技术并根据需要进行配置。

目前,实现此目的的最简单方法是使用所需的设置对您的应用程序进行容器化,或者派生我们现有的内置容器之一。

You can add custom storage for your containerized app. Containerized apps include all Linux apps and also the Windows and Linux custom containers running on App Service.

更多详情可以引用这个article .

关于node.js - 未显示 Azure Web App/虚拟目录上的 Node 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62810572/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com