标签墙

NGINX

PHP 异步 HTTP 与 NGINX 499

PHP 异步 HTTP 在 PHP 代码中提交异步 HTTP 请求比较常用的方式是通过 fsockopen/fwrite/fclose 来实现,请参考如下代码。 function post($host, $path, $port, $data) { $post = http_build_query($data); $len = strlen($post); $fp = fsockopen($host, $port, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)\n"; return; } $out = "POST $path HTTP/1.1\r\n"; $out .= "Host: $host\r\n"; $out .= "Content-type: application/x-www-form-urlencoded\r\n"; $out .= "Connection: Close\r\n"; $out .= "Content-Length: $len\r\n"; $out .= "\r\n"; $out .= $p....

More...

使用 NGINX 流控和 fail2ban 防止 CC 攻击

More...