Azure的网站已不返回响应主体错误 [英] Azure WebSites doesn't return response body for errors

查看:200
本文介绍了Azure的网站已不返回响应主体错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下配置:部署在Azure网站的Python TornadoWeb应用。该应用程序实际上是REST API返回的JSON回来。但是...一切工作正常,如果响应code是200,但如果响应code是像50倍或40倍的任何响应不包含任何机构(尽管仍然应该是JSON机身采用错误的详细信息) 。测试相同的code本地直接龙卷风或通过nginx的工作。显然,IIS过滤身体,但真的不知道什么设置,以便更改为避免这种情况。任何想法?

I have the following configuration: Python TornadoWeb application deployed on Azure Web Sites. The application is actually REST API that returns JSON back. However... everything works fine if the response code is 200 but if the response code is anything like 50x or 40x the response doesn't contain any body (although there should still be JSON body with error details). Testing the same code locally directly to Tornado or via NGiNX works. Apparently, IIS filters the body but not really sure what settings to change in order to avoid this. Any ideas?

推荐答案

请尽量参考章节<一个href=\"https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-configure/#wsgi-handler\"相对=nofollow> WSGI处理程序 和<一个href=\"https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-configure/#webconfig\"相对=nofollow> 的Web.config 的文档配置的Python与Azure的应用程序服务Web应用程序,为你的Python龙卷风配置和code的Web应用中 WSGI服务器上运行的应用程序龙卷风

如果您创建了一个Web应用程序的Azure为Python,你可以做下面的步骤。

If you created a Azure WebApp for Python, you can do the steps below.


  1. 创建的库杜路径的wwwroot A 的web.config 文件,然后复制从部分<配置内容code>的Web.config 。

  2. 创建的库杜路径 app.py 文件的wwwroot ,然后code作为部分 WSGI处理程序

  3. 尝试启动和访问web应用程序。

  4. 重新code。使用龙卷风的web应用程序。

  1. Create a web.config file in the Kudu path wwwroot, then copy the configuration content from the section Web.config.
  2. Create a app.py file in the Kudu path wwwroot, then code as the section WSGI Handler.
  3. Try to start and access the webapp.
  4. Recode the webapp using Tornado.

这篇关于Azure的网站已不返回响应主体错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆