- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我以前从未使用过 Azure,我遵循了以下教程:https://learn.microsoft.com/en-us/azure/app-service/app-service-web-get-started-nodejs#create-a-project-zip-file
当我尝试在 Azure 上部署由 Node.js 制作的简单应用程序时,出现权限错误。我已尝试重新上传多次,但每次都会遇到相同的错误。我正在使用 Azure 免费试用版。
这是package.json和web.config
包.JSON:
{
"name": "oslo-solutions",
"version": "1.0.0",
"description": "",
"main": "scripts.js",
"scripts": {
"test": "karma start karma.conf.js",
"build": "webpack --mode development",
"start": "webpack-dev-server --open",
"lint": "eslint src/*.js",
"jinit": "./node_modules/.bin/jasmine init",
"npminit": ""
},
"repository": {
"type": "git"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.2",
"bootstrap": "^4.0.0",
"express": "^4.16.3",
"jquery": "^3.3.1",
"lodash": "^4.17.5",
"popper.js": "^1.14.1"
},
"homepage": "/",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.3",
"babel-preset-es2015": "^6.24.1",
"clean-webpack-plugin": "^0.1.19",
"css-loader": "^0.28.10",
"dotenv-webpack": "^1.5.5",
"eslint": "^4.18.2",
"eslint-loader": "^2.0.0",
"html-webpack-plugin": "^3.0.6",
"jasmine": "^3.1.0",
"jasmine-core": "^2.99.0",
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-jquery": "^0.2.2",
"karma-webpack": "^2.0.13",
"style-loader": "^0.20.3",
"uglifyjs-webpack-plugin": "^1.2.2",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.11",
"webpack-dev-server": "^3.1.1"
}
}
网络配置:
<configuration>
<system.webServer>
<!-- indicates that the index.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="scripts.js" verb="*" modules="iisnode" />
</handlers>
<!-- adds index.js to the default document list to allow
URLs that only specify the application root location,
e.g. http://mysite.antarescloud.com/ -->
<defaultDocument enabled="true">
<files>
<add value="scripts.js" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
最佳答案
我遵循了这个示例node.js应用程序:nodejs-docs-hello-world部署到azure上,效果很好,请引用 web.config
文件:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation batch="false" />
</system.web>
<system.webServer>
<handlers>
<add name="iisnode" path="scripts.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="myapp">
<match url="/*" />
<action type="Rewrite" url="scripts.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
我建议您导航至KUDU
网址:https://<your app name>.scm.azurewebsites.net/DebugConsole
并转到site\wwwroot
检查文件是否包含在目录中。
或者暂时放弃zip部署,直接将本地文件拖到d:home\site\wwwroot
即可目录并重试。
更多解决方案,请引用以下帖子:
2. https://github.com/Azure-Samples/nodejs-docs-hello-world/issues/9
希望对您有帮助,如有任何疑问,请告诉我。
关于azure - Azure 中的 "You do not have permission to view this directory or page"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51452336/
我是一名优秀的程序员,十分优秀!