dns和错误:无法加载资源:服务器响应状态为502(错误网关)

时间:2013-04-06 18:55:54

标签: asp.net-mvc azure web

今天我遇到了502错误的大问题。 这是详细信息: 在azure网站上,当我使用时,它可以很好地工作:http://mywebsite.cloudapp.net/ 但是当我在http://www.mywebsite.com上指向dns时,某些操作(并非所有操作)都返回了502错误。这很奇怪,因为当我在http://mywebsite.cloudapp.net/上使用相同的动作时,它完美无缺。

注意:“mywebsite”是网站的假名。

请帮忙

代理是否会出现问题?


更新: 我注意到它发生在“PUT”命令中,“GET”用于其他请求。可能问题是“PUT”命令和一些DNS设置?还是代理?

以下是服务器的响应:

"response": {
  "status": 502,
  "statusText": "Bad Gateway",
  "httpVersion": "HTTP/1.1",
  "headers": [
    {
      "name": "Date",
      "value": "Sat, 06 Apr 2013 18:33:08 GMT"
    },
    {
      "name": "Server",
      "value": "Microsoft-IIS/7.5"
    },
    {
      "name": "X-Powered-By",
      "value": "ASP.NET"
    },
    {
      "name": "Content-Length",
      "value": "1477"
    },
    {
      "name": "Content-Type",
      "value": "text/html"
    }
  ],
  "cookies": [],
  "content": {
    "size": 1477,
    "mimeType": "text/html",
    "compression": 0,
    "text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"/>\r\n<title>502 - Web server received an invalid response while acting as a gateway or proxy server.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;} \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div class=\"content-container\"><fieldset>\r\n  <h2>502 - Web server received an invalid response while acting as a gateway or proxy server.</h2>\r\n  <h3>There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.</h3>\r\n </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n"
  },
  "redirectURL": "",
  "headersSize": 162,
  "bodySize": 1477
},

1 个答案:

答案 0 :(得分:0)

我能够解决这个问题。 只是在godaddy中,DNS设置不正确。我必须在“A”记录中为azure webrole(NOT WEBSITE)设置IP地址。现在它完美无缺。