为'artisan down'提供 200 状态代码?



我目前正在使用数字海洋应用程序平台来托管Laravel应用程序。

当我运行php artisan down时,我收到了一个数字海洋错误页面,我认为是他们的负载均衡器,说应用程序无法加载。这是因为该应用程序正在为该页面提供503状态代码。

是否可以为php artisan down提供200状态代码,以便显示我的503.blade模板而不是数字海洋页面?

文档中没有提到它,但运行artisan down --help会给出答案:

Description:
Put the application into maintenance / demo mode
Usage:
down [options]
Options:
--redirect[=REDIRECT]  The path that users should be redirected to
--render[=RENDER]      The view that should be prerendered for display during maintenance mode
--retry[=RETRY]        The number of seconds after which the request may be retried
--refresh[=REFRESH]    The number of seconds after which the browser may refresh
--secret[=SECRET]      The secret phrase that may be used to bypass maintenance mode
--status[=STATUS]      The status code that should be used when returning the maintenance mode response [default: "503"]
-h, --help                 Display help for the given command. When no command is given display help for the list command
-q, --quiet                Do not output any message
-V, --version              Display this application version
--ansi|--no-ansi       Force (or disable --no-ansi) ANSI output
-n, --no-interaction       Do not ask any interactive question
--env[=ENV]            The environment the command should run under
-v|vv|vvv, --verbose       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

所以你想做artisan down --status=200

相关内容

  • 没有找到相关文章

最新更新