os-nginx : Allow changing error page file extension
Important notices Before you add a new report, we ask you kindly to acknowledge the following:
- [x] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- [x] I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- [x] When the request is meant for an existing plugin, I've added its name to the title.
Is your feature request related to a problem? Please describe.
I'd like to send a json error page but the created file have html extension so content type is not application/json
Describe the solution you'd like
I did change in /usr/local/etc/nginx/nginx.conf the error file name (twice) with json extension and did rename the file /usr/local/etc/nginx/views/error_someuuid.html with json extension and it works great, I have a json mime type response, but I must do that for every changes made via UI
That could be possible to add an extension field to the error page settings that would allow to set json or anything else, with html as default
that could be read here : https://github.com/opnsense/plugins/blob/b8af35970ea0963cb4cdf405334f5294311e2382/www/nginx/src/opnsense/scripts/nginx/setup.php#L296
and change here https://github.com/opnsense/plugins/blob/b8af35970ea0963cb4cdf405334f5294311e2382/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/errorpage.xml