Skip to content

os-nginx : Allow changing error page file extension #4684

Open
@Nemric

Description

@Nemric

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

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 :

foreach ($nginx->errorpage->iterateItems() as $errorpage) {

and change here
https://github.com/opnsense/plugins/blob/b8af35970ea0963cb4cdf405334f5294311e2382/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/errorpage.xml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions