219 lines
7.9 KiB
HTML
219 lines
7.9 KiB
HTML
|
||
<!doctype html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>504禁止页面模板</title>
|
||
|
||
|
||
<style>
|
||
/* cyrillic-ext */
|
||
@font-face {
|
||
font-family: 'Montserrat';
|
||
font-style: normal;
|
||
font-weight: 700;
|
||
src: local('Montserrat Bold'), local('Montserrat-Bold'), url(font/JTURjIg1_i6t8kCHKm45_dJE3gTD_u50.woff2) format('woff2');
|
||
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||
}
|
||
/* cyrillic */
|
||
@font-face {
|
||
font-family: 'Montserrat';
|
||
font-style: normal;
|
||
font-weight: 700;
|
||
src: local('Montserrat Bold'), local('Montserrat-Bold'), url(font/JTURjIg1_i6t8kCHKm45_dJE3g3D_u50.woff2) format('woff2');
|
||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||
}
|
||
/* vietnamese */
|
||
@font-face {
|
||
font-family: 'Montserrat';
|
||
font-style: normal;
|
||
font-weight: 700;
|
||
src: local('Montserrat Bold'), local('Montserrat-Bold'), url(font/JTURjIg1_i6t8kCHKm45_dJE3gbD_u50.woff2) format('woff2');
|
||
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
|
||
}
|
||
/* latin-ext */
|
||
@font-face {
|
||
font-family: 'Montserrat';
|
||
font-style: normal;
|
||
font-weight: 700;
|
||
src: local('Montserrat Bold'), local('Montserrat-Bold'), url(font/JTURjIg1_i6t8kCHKm45_dJE3gfD_u50.woff2) format('woff2');
|
||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||
}
|
||
/* latin */
|
||
@font-face {
|
||
font-family: 'Montserrat';
|
||
font-style: normal;
|
||
font-weight: 700;
|
||
src: local('Montserrat Bold'), local('Montserrat-Bold'), url(font/JTURjIg1_i6t8kCHKm45_dJE3gnD_g.woff2) format('woff2');
|
||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||
}
|
||
/* latin */
|
||
@font-face {
|
||
font-family: 'Share Tech Mono';
|
||
font-style: normal;
|
||
font-weight: 400;
|
||
src: local('Share Tech Mono'), local('ShareTechMono-Regular'), url(https://fonts.gstatic.com/s/sharetechmono/v8/J7aHnp1uDWRBEqV98dVQztYldFcLowEF.woff2) format('woff2');
|
||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||
}
|
||
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
border: 0;
|
||
font-size: 100%;
|
||
font: inherit;
|
||
vertical-align: baseline;
|
||
box-sizing: border-box;
|
||
color: inherit;
|
||
}
|
||
|
||
body {
|
||
background-image: linear-gradient(120deg, #008856 0%, #000000 100%);
|
||
height: 100vh;
|
||
}
|
||
|
||
h1 {
|
||
font-size: 45vw;
|
||
text-align: center;
|
||
position: fixed;
|
||
width: 100vw;
|
||
z-index: 1;
|
||
color: #ffffff26;
|
||
text-shadow: 0 0 50px rgba(0, 0, 0, 0.07);
|
||
top: 50%;
|
||
-webkit-transform: translateY(-50%);
|
||
transform: translateY(-50%);
|
||
font-family: "Montserrat", monospace;
|
||
}
|
||
|
||
div {
|
||
background: rgba(0, 0, 0, 0);
|
||
width: 70vw;
|
||
position: relative;
|
||
top: 50%;
|
||
-webkit-transform: translateY(-50%);
|
||
transform: translateY(-50%);
|
||
margin: 0 auto;
|
||
padding: 30px 30px 10px;
|
||
box-shadow: 0 0 150px -20px rgba(0, 0, 0, 0.5);
|
||
z-index: 3;
|
||
}
|
||
|
||
P {
|
||
font-family: "Share Tech Mono", monospace;
|
||
color: #f5f5f5;
|
||
margin: 0 0 20px;
|
||
font-size: 17px;
|
||
line-height: 1.2;
|
||
}
|
||
|
||
span {
|
||
color: #f0c674;
|
||
}
|
||
|
||
i {
|
||
color: #8abeb7;
|
||
}
|
||
|
||
div a {
|
||
text-decoration: none;
|
||
}
|
||
|
||
b {
|
||
color: #81a2be;
|
||
}
|
||
|
||
a.avatar {
|
||
position: fixed;
|
||
bottom: 15px;
|
||
right: -100px;
|
||
-webkit-animation: slide 0.5s 4.5s forwards;
|
||
animation: slide 0.5s 4.5s forwards;
|
||
display: block;
|
||
z-index: 4
|
||
}
|
||
|
||
a.avatar img {
|
||
border-radius: 100%;
|
||
width: 44px;
|
||
border: 2px solid white;
|
||
}
|
||
|
||
@-webkit-keyframes slide {
|
||
from {
|
||
right: -100px;
|
||
-webkit-transform: rotate(360deg);
|
||
transform: rotate(360deg);
|
||
opacity: 0;
|
||
}
|
||
to {
|
||
right: 15px;
|
||
-webkit-transform: rotate(0deg);
|
||
transform: rotate(0deg);
|
||
opacity: 1;
|
||
}
|
||
}
|
||
|
||
@keyframes slide {
|
||
from {
|
||
right: -100px;
|
||
-webkit-transform: rotate(360deg);
|
||
transform: rotate(360deg);
|
||
opacity: 0;
|
||
}
|
||
to {
|
||
right: 15px;
|
||
-webkit-transform: rotate(0deg);
|
||
transform: rotate(0deg);
|
||
opacity: 1;
|
||
}
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<h1>504</h1>
|
||
<div><p>> <span>错误代码</span>: "<i>504 Gateway timeout </i>"</p>
|
||
<p>> <span>错误原因1</span>: [<b>后端电脑之间 IP 通讯缓慢而产生</b>]</span> "<i>解决办法:如果您的 Web 服务器由某一网站托管, 只有负责那个网站设置的人员才能解决这个问题。</i>"</p>
|
||
<p>> <span>错误原因2</span>: [<b>由于nginx默认的fastcgi进程响应的缓冲区太小造成的错误</b>]</span> "<i>解决办法:一般默认的fastcgi进程响应的缓冲区是8K,这时可以设置大一点,在nginx.conf里,加入:fastcgi_buffers 8 128k这表示设置fastcgi缓冲区为8块128k大小的空间。当然如果在进行某一项即时的操作, 可能需要nginx的超时参数调大点, 例如设置成60秒:send_timeout 60;经过这两个参数的调整,一般不会再提示“504 Gateway Time-out”错误,问题基本解决。</i>"</p>
|
||
<p>> <span>错误原因3</span>: [<b>PHP环境的配置问题</b>]</span> "<i>解决办法:更改php-fpm的几处配置:
|
||
|
||
把max_children由之前的10改为现在的30,这样就可以保证有充足的php-cgi进程可以被使用;
|
||
|
||
把request_terminate_timeout由之前的0s改为60s,这样php-cgi进程 处理脚本的超时时间就是60秒,可以防止进程都被挂起,提高利用效率。
|
||
|
||
接着再更改nginx的几个配置项,减少FastCGI的请求次数,尽量维持buffers不变:
|
||
|
||
fastcgi_buffers由 4 64k 改为 2 256k;
|
||
|
||
fastcgi_buffer_size 由 64k 改为 128K;
|
||
|
||
fastcgi_busy_buffers_size 由 128K 改为 256K;
|
||
|
||
fastcgi_temp_file_write_size 由 128K 改为 256K。
|
||
|
||
重新加载php-fpm和nginx的配置,再次测试,如果没有出现“504 Gateway Time-out”错误,问题解决。</i>"</p>
|
||
|
||
<p>> <span>温馨提醒</span>: [<b>如果以上解决办法</b>]</span> "<i>全部尝试后依然无法解决问题,请到http://www.phpsutyd.net论坛中发帖寻求帮助。</i>"</p>
|
||
|
||
</div>
|
||
|
||
|
||
<script>
|
||
var str = document.getElementsByTagName('div')[0].innerHTML.toString();
|
||
var i = 0;
|
||
document.getElementsByTagName('div')[0].innerHTML = "";
|
||
|
||
setTimeout(function() {
|
||
var se = setInterval(function() {
|
||
i++;
|
||
document.getElementsByTagName('div')[0].innerHTML = str.slice(0, i) + "|";
|
||
if (i == str.length) {
|
||
clearInterval(se);
|
||
document.getElementsByTagName('div')[0].innerHTML = str;
|
||
}
|
||
}, 10);
|
||
},0);
|
||
</script>
|
||
|
||
</body>
|
||
</html>
|