You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: allow nginx 500 error page to be disabled (#34)
Closes#31
This PR introduces a new cli command for controlling the visibility of
**all** Valet's custom nginx error pages (**both 404 and 500**), updates
nginx configuration handling to respect this setting, and enable the
error pages by default. Additionally, it includes minor improvements to
configuration management and code quality.
**Nginx error page configurability:**
* Added a new `nginx_error_page` configuration key (default `'on'`) to
control whether Valet's nginx error page is enabled. This key will now
be included for new configs, and for existing configs, it will
automatically be added if it's missing via the Upgrader processes.
* Updated Valet's main nginx config stub, and add logic to use the
`nginx_error_page` setting in the `Nginx::installServer` method,
allowing dynamic enabling or disabling of Valet's error pages.
* Added a new `valet nginx-error-page` CLI command to display or update
the visibility of the nginx error pages, including automatic nginx
reload when changed.
**Configuration and Upgrader:**
* Extracted the "missing default config keys" code from
`writeBaseConfiguration` into a new `addMissingDefaultConfigKeys`
Configuration method for better maintainability and to enable it's usage
in the Upgrader.
* Added new `addMissingConfigKeys` Upgrader method to call the
`addMissingDefaultConfigKeys` Configuration method during upgrades to
add any missing default config keys to existing installations.
@@ -1421,6 +1431,23 @@ Parity at 87% out of a total 92% possible parity with the Laravel Valet (macOS)
1421
1431
1422
1432
This command is a way to determine how much parity has been achieved.
1423
1433
1434
+
##### nginx-error-page
1435
+
1436
+
```
1437
+
nginx-error-page Display the current visibility of the nginx error page.
1438
+
[visibility] Optionally, set to "on" to enable Valet's nginx error page, or "off" to disable it.
1439
+
```
1440
+
1441
+
```console
1442
+
$ valet nginx-error-page
1443
+
Valet's nginx error pages are on.
1444
+
1445
+
$ valet nginx-error-page off
1446
+
Valet's nginx error pages are now off.
1447
+
```
1448
+
1449
+
The nginx error pages are `on` (enabled) by default, which means that Valet's custom nginx 404/500 error pages will be shown when an error is encountered. However, for those who prefer to use a framework's error reporting exception pages like that of Symfony or Laravel, Valet's nginx error pages can be turned `off` (disabled).
0 commit comments