我目前正在开发一个tumblr主题,并构建了一个jQuery JSON thingamabob,它使用Tumblr API执行以下操作:
用户可以点击"帖子类型"链接(例如视频帖子),在这个阶段,jQuery将使用JSON获取与该类型相关的所有帖子,然后在指定区域中动态显示它们.
现在一切都工作得非常好,除了Tumblr是Tumblr并且他们的服务器时不时地敲门,Tumblr API有时候离线了.现在我无法预见此函数何时会关闭,这就是为什么我想显示一些通用错误消息,如果JSON(无论出于何种原因)无法加载帖子.
您会看到我已经编写了一些代码来显示错误消息,当jQuery找不到与该帖子类型相关的任何帖子但是它不包含任何服务器错误.注意:我有时会收到此错误:
无法加载资源:服务器响应状态为503(服务暂时不可用)
这是503错误消息,我需要编写一些代码,但我有点无能:)
这是jQuery JSON代码:
$('ul.right li').find('a').click(function() {
var postType = this.className;
var count = 0;
byCategory(postType);
return false;
function byCategory(postType, callback) {
$.getJSON('{URL}/api/read/json?type=' + postType + '&callback=?', function(data) {
var article = [];
$.each(data.posts, function(i, item) {
// i = index
// item = data for a particular post
switch(item.type) {
case 'photo':
article[i] = '<div class="post_wrap"><div class="photo" style="padding-bottom:5px;">'
+ '<a href="' + item.url + '" title="{Title}" class="type_icon"><img src="http://static.tumblr.com/ewjv7ap/XSTldh6ds/photo_icon.png" alt="type_icon"/></a>'
+ '<a …Run Code Online (Sandbox Code Playgroud) 我使用mod_jk设置在端口80上运行apache2和tomcat6(未从apt存储库安装,手动下载和安装).访问jsp servlet页面,将浏览器指向http://myapp.mydomain.com/(虚拟主机在tomcat(server.xml)和apache中完成).在部署期间,当tomcat关闭(pkill -9 java或/etc/init.d/tomcat stop)时,我正在尝试将tomcat的错误页面503重定向到自定义错误页面.
我的apache的Document Root是/ var/www/so我把它放在apache2.conf文件的下面
ErrorDocument 503 maintenance.html并在/ var/www下创建了一个文件maintenance.html.当我测试停止tomcat并且我将页面重定向到maintenance.html而没有更改url但是没有显示实际页面,而是maintenance.html在浏览器上显示文件名.任何人都可以帮我正确配置当tomcat关闭时重定向到正确的maintenance.html页面的apache吗?
503 ("Service Unavailable")当请求的操作导致数据库死锁时,服务器返回是否合适?
这是我的理由:
503 Service Unavailable无论如何客户端都更有可能看到。视为:
503 Service Unavailable无论如何都要能够处理。我倾向于这种解决方案。你怎么看?
更新:我认为503 ("Service Unavailable")如果您希望返回仍然可以接受,但是我不再认为这是技术要求。参见/sf/answers/1257203321/。
我在VirtualBox VM(Boot2docker)中使用Haproxy 1.5.14,其中间歇性加载的资产显示503没有任何真正的押韵或原因,在群集启动时尤其如此.
集群看起来像这样,1个前端有端口80,443到2个后端分别为静态资源和websocket东西提供服务.
HAProxy的
例如,前端服务的静态资产可能是
https://local.dev.myproject.com/assets/images/back.png
尽管前端服务器正在运行,并且没有任何变化,但是点击刷新并查看chrome调试器,我将看到许多状态503或OK 200 304,但它不是确定的.任何资产都可以从503到OK再到503.当直接连接到网络服务器时,资产返回正常,所以它看起来像haproxy.
我能想到的最好的是健康检查工作不正常,并且正在从haproxy的内部名册暂时删除FE/BE服务器,但这没有意义,它每隔半秒检查一次,我可以看到haproxy的调用是发送由FE/BE终端输出窗口返回,按预期每半秒发送一次.
如果我查看haproxy统计报告,我可以看到服务器定期来来去去,闪烁,尽管在终端窗口中haproxy仍然无间隙地调用运行状况检查,服务器按预期返回它们.
附件是我正在使用的当前haproxy配置,任何帮助表示赞赏.
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# …Run Code Online (Sandbox Code Playgroud) 我有Windows 10,我想运行IIS.我已经为它激活了所有功能,你可以在这里看到.然后我在浏览器中键入"localhost",然后我接受
"Http错误503服务不可用."
在一些论坛中,他们说控制日志HTTP错误文件,所以我这样做,但它是空的.
然后我去ISS经理查看配置.
我怎样才能解决这个"Il服务器conf configurato per l'uso dell'autenticazione pass-through con un account predefinito per accedere al percorso fisico specificato.Tuttavia,Gestione IISnonpuòverificarese l'account predefinito ha l'accesso.Verificare che l'identitàdelpool di applicazioni abbia l'accesso in lettura al percorso fisico.Se questoserverèagoniuntoun dominio e l'identitàdelpool diapplicazionièNetworkServiceo LocalSystem,verificare che' <dominio>\<nome_computer> $ ' abbia l'accesso in lettura al percorso fisico,quindi riprovare queste impostazioni." ?
我知道我必须验证App池的身份是否具有物理路径的读取权限.请帮我.谢谢.
关于为什么pubsub请求似乎会触发这么多503错误的问题?这很常见吗?似乎其他人看到了类似的内容,但我的大部分请求最终都以这种方式结束
相似
http-status-code-503 google-cloud-platform google-cloud-pubsub
我在windows azure中部署了nodeJS服务器.连接到服务器时我的客户端失败并处理以下错误:
WebSocket connection to 'wss://ooplrfrfranode.azurewebsites.net/socket.io/1/websocket/lHrd-DOydinODjbS7-tc' failed: Error during WebSocket handshake: Unexpected response code: 503.
Run Code Online (Sandbox Code Playgroud)
请帮忙.谢谢.
我有一个工作的ASP.NET应用程序在自动生成的端口上运行,如53000.在移动到另一个端口(在我的情况下为8080)后,IIS Express开始响应503 Service Unavailable.其他港口确实有效.
Internet上有很多关于检查内容和调试方法的提示,而在大多数情况下,提示与IIS相关或从远程计算机访问.不过我试过了:
%userprofile%\Documents\IISExpress\config\applicationhost.confignetsh http add urlacl url=http://mymachinename:50333/ user=everyonenetstat- 没问题我没有检查防火墙和文件夹权限,因为应用程序是从其他端口提供的.
在管理员下清除Magento中的缓存后,我收到503错误"服务暂时不可用".要清楚,这是由清除缓存引起的'var/cache'.这与可能导致相同或类似问题的维护问题无关(由已删除的maintenance.flag文件解决).应用程序的根目录中不存在维护标志.我已经尝试过研究这个问题,似乎每个帖子都会回到维护问题.
有一点需要注意; 503错误是Web Server生成的.维护问题返回503但是应用程序(Magento)返回它; 所以你看到应用程序徽标,链接等等.
我检查了Web服务器日志,并生成以下错误:
539 access forbidden by rule, client: 165.225.138.177, server: , request: "POST /app/etc/local.xml HTTP/1.1"
Run Code Online (Sandbox Code Playgroud)
我检查了文件,这对我来说很明显,这是由于所有权冲突; 我更改了文件所有者,但问题仍然存在.
检查Magento错误日志,var/reports我看到以下错误:
the error log (var/reports) reflects the following error: "Mage registry key "_singleton/" already exists"
Run Code Online (Sandbox Code Playgroud)
完整的错误是:
a:5:{i:0;s:46:"Mage registry key "_singleton/" already exists";i:1;s:1157:"
#0 /data/html/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /data/html/app/Mage.php(477): Mage::register('_singleton/', false)
#2 /data/html/app/code/core/Mage/Core/Model/Factory.php(81): Mage::getSingleton(false, Array)
#3 /data/html/app/code/core/Enterprise/UrlRewrite/Model/Url/Rewrite.php(94): Mage_Core_Model_Factory->getSingleton(false)
#4 /data/html/app/code/core/Enterprise/UrlRewrite/Model/Url/Rewrite/Request.php(114): Enterprise_UrlRewrite_Model_Url_Rewrite->loadByRequestPath(Array)
#5 /data/html/app/code/core/Enterprise/UrlRewrite/Model/Url/Rewrite/Request.php(58): Enterprise_UrlRewrite_Model_Url_Rewrite_Request->_loadRewrite()
#6 /data/html/app/code/core/Mage/Core/Model/Url/Rewrite/Request.php(116): Enterprise_UrlRewrite_Model_Url_Rewrite_Request->_rewriteDb()
#7 /data/html/app/code/core/Mage/Core/Controller/Varien/Front.php(165): Mage_Core_Model_Url_Rewrite_Request->rewrite()
#8 /data/html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch() …Run Code Online (Sandbox Code Playgroud) 我正在尝试发出 HTTP 请求,但我目前可以从 Firefox 浏览器响应 503 错误访问的网站。代码本身非常简单。在网上进行了一些搜索后,我user-Agent向请求添加了参数,但它也没有帮助。有人可以解释我如何摆脱这个 503 错误吗?顺便说一句,我想根据 btc 的价格制作自己的警报系统。
import requests
url = "https://www.paribu.com"
header ={'User-Agent': 'Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0) Gecko/20100101 Firefox/10.0 '}
response = requests.get(url,headers = header)
print(response)
Run Code Online (Sandbox Code Playgroud) asp.net ×2
apache2 ×1
azure ×1
boot2docker ×1
caching ×1
docker ×1
haproxy ×1
http ×1
iis ×1
iis-express ×1
javascript ×1
jquery ×1
json ×1
magento ×1
node.js ×1
python ×1
python-3.x ×1
request ×1
rest ×1
server-error ×1
tomcat ×1
tumblr ×1
windows-10 ×1