服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

如何为nginx错误502页面创build自定义内容,在浏览器上保留原始URL

我试图让nginx错误页面的自定义语言和消息,但保持在浏览器的url..不成功例如:我去的url:xaluan.com/aaa/bbb.html时间服务器下来.. nginx将显示错误502.与我的语言相同的url,但自定义消息。 testing1。 我在/usr/local/nginx/html/205.html创build了一个自定义页面 作为以下configuration,但它显示在网站上,当错误是默认的nginx错误在domain.com/50.html(网页的内容不同于我创build的) error_page 502 /502.html; location = /502.html { root /usr/local/nginx/html; } testing2.然后我创build相同的页面在我的WWW域名文件夹/ home / xuanuan / public_html / 502.html,但是这保持redirect到根domain.com/502.html的内容现在一样,我创build。 但..url仍然不是我所需要的 error_page 502 /502.html; location = /502.html { root /home/xaluano/public_html; internal; } 编辑更新的更多细节10/06/2012请下载我的nginxconfigurationhttp://pastebin.com/7iLD6WQq和vhostconfiguration如下: http : //pastebin.com/ZZ91KiY6 == 案例testing 如果apache httpd服务停止:#service httpd stop 然后打开浏览器转到: xaluan.com/modules.php?name=News&file=article&sid=123456 我将在浏览器地址上看到与url相同的502错误 == 自定义错误页面我需要的帮助,当阿帕奇失败的configuration..将显示自定义消息告诉用户哀嚎1分钟服务回来,然后使用相同的URL(刷新我可以轻松通过JavaScript)刷新当前页面,Nginx剂量变化所以Java脚本可以解决这个问题。 任何帮助将是伟大的..提前感谢