Unable to set nginx directives

Discussion in 'Installation/Configuration' started by SamKr, Jan 28, 2025.

  1. SamKr

    SamKr New Member

    I'm trying to set the nginx directives for the plugins from mattplugins dot com. Since I'm not allowed to post a link, this is the manual from their docs:

    When I, as a test, manually set the directives in the relevant .vhost file before other location { ... } directives (as stated in the manual), it works. But of course, changing anything in ISPConfig overwrites this. So I've been trying to accomplish this using the nginx directives field, but to no avail.

    For starters, I wanted to get the directives in the vhost file, no matter the location. But they don't show up, at all. So I added a test directive '
    client_max_body_size 200M;', making it look as such:

    upload_2025-1-28_14-55-21.png

    However, after saving, only the test directive is set:

    upload_2025-1-28_14-56-14.png

    The other is nowhere to be found.

    I purchased and read the manual. As it says, I experimented with the ##merge## functionality:
    upload_2025-1-28_14-57-3.png
    But this lead to the same result. The other parts of the directives:

    Code:
    set $ext_avif ".avif";
    if ($http_accept !~* "image/avif") {
        set $ext_avif "";
    }
     
    set $ext_webp ".webp";
    if ($http_accept !~* "image/webp") {
        set $ext_webp "";
    }


    Also won't remain.

    So my questions are:

    Why am I unable to have these directives stick, neither as-is nor merged?
    Is it possible to have these directives set above all other location directives?

    I'm running ISPConfig 3.2.11 on Ubuntu 22.04.3 LTS.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    If Nginx is unable to start with the generated config based on what you have set in the Nginx directives field, then the last working config is used, and the nonworking config is saved as a .err file in the nginx sites-available folder. See read before posting on how to debug it if changes can not be applied: https://forum.howtoforge.com/threads/please-read-before-posting.58408/
     
  3. SamKr

    SamKr New Member

    There was a .err file from a couple of hours ago with an old version, but it doesn't get updated when I set any of the mentioned directives. I tried adding:

    Code:
    set $ext_avif ".avif";
    if ($http_accept !~* "image/avif") {
        set $ext_avif "";
    }
    
    set $ext_webp ".webp";
    if ($http_accept !~* "image/webp") {
        set $ext_webp "";
    }
    But it doesn't show up in the .vhost file, nor is a .err file created. I'm not sure what part of the read-before-posting section applies to this particular issue, sorry. Can you please point me in the right direction?

     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    From the post:

     

Share This Page