nginx系统中http状态码修改方法

作者:袖梨 2022-06-30

1,修改php.ini

cgi.fix_pathinfo=1
cgi.force_redirect=1
cgi.rfc2616_headers=1

把上面三个设置注释掉,就可以了。
2,php测试文件


header('HTTP/1.1 7001 this is test');
header('Content-type: application/json' );
exit;
?>
3,看结果

http 自定义 code 7001

相关文章

精彩推荐