首页

php在nginx下自定义40x、50x错误页面

nginx默认的错误页面很简陋,要自定义错误页面就需要自己配置。当然,如果使用主流的比如tp、laravel这些php框架采用单入口模式是能自己配置错误页面。但.php后缀的文件依旧需要nginx的配置支持。配置如下: <code> error_page 404 500 502 503 504 /50x.html; location = /50x.html { root /你的项目根目录; } location ~* \.php$ { fastcgi_index index.php; try_files $uri = 404; ......其他配置...... } </code> 要保证项目根目录下存在自定义的50x.html
更多>>
昨晚又折腾了下玩客云,终于圆满刷了armbian 免费ssl证书的自动续期 神奇的空白字符 docker学习笔记(其二) android开发学习日志(其二)