Skip to main content

Edit NGINX config or prevent it from resetting to default

Comments

6 comments

  • cPRex Jurassic Moderator

    Hey there!  Are you able to create one of the custom include files as outlined here?

    https://docs.cpanel.net/knowledge-base/nginx/customize-reverse-proxy-nginx-configurations/

    I would expect custom files to *not* be overwritten at any point.

    0
  • V3NTUS

    Hi cPRex,

    first of all thank you for what you do here, you're very active and your help is not unnoticed.

    I tried to add a server or a location block in a custom file as per instructions, but nginx doesn't rebuild succesfully as it indicates a duplicate entry whenever I do so.

    0
  • cPRex Jurassic Moderator

    Thanks for the kind words!

    I'm wondering if these are defined somewhere else on your system already, as the following worked well for me:

    -created a "custom.conf" file in /etc/nginx/conf.d
    -added the values you included above
    -rebuilt with the"/scripts/ea-nginx config --all" command

    and things restarted normally.

    Can you try this command to see if you've already added one of those values in another file?

    grep -Ri "proxy_buffering" /etc/nginx/*

    since our default installation of Nginx is not including that, at least on a test machine.

    Note: if your duplicate entry isn't the proxy_buffering value you may need to alter that search to find the specific one you're looking for, but it wouldn't take long to try all four.

    0
  • Bill Williams

    I ran the command and got the result

    $ grep -Ri "client_max_body_size" /etc/nginx/*
    /etc/nginx/conf.d/ea-nginx.conf:client_max_body_size 128m;
    /etc/nginx/ea-nginx/settings.json:   "client_max_body_size" : "0"
    /etc/nginx/ea-nginx/ea-nginx.conf.tt:client_max_body_size [% settings.client_max_body_size %];
    /etc/nginx/ea-nginx/settings.json.rpmsave:   "client_max_body_size" : "128m"

     

    Which of these will take precedence?

    0
  • cPRex Jurassic Moderator

    .tt and .rpmsave aren't "active" configuration files, so those don't matter for us.

    ea-nginx.conf is likely the one you manually added at some point, correct?  And that will get overwritten at some point.

    Personally - I would manually remove *both* of the entries from ea-nginx.conf and settings.json and create the custom conf file and that should stay put forever.

    0
  • Bill Williams

    ... my bad ...

    0

Please sign in to leave a comment.