[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can nginx "events" block be configured in an include file?



On Tue, Nov 03, 2020 at 03:35:58AM -0600, Dave Sherohman wrote:
> tl;dr:  I need to increase worker_connections on my nginx servers, but
> don't want to edit the debian-provided nginx.conf due to that causing
> future upgrade hassles.  Is this possible?

> Is there any way to accomplish this using only new files of my own
> creation, while leaving all debian-provided config files in a pristine
> state?

No.

You will have to edit the nginx.conf file, and this could, in theory,
cause you to need to merge new versions of the nginx.conf file on
release upgrades.

Basically, any section of the nginx.conf file can be split out into
its own separate file, and replaced with an "include" directive in
the main file.

So, copy the "events" block from nginx.conf into your own file with
whatever name you like, and then replace that block with
"include /etc/nginx/yourfile;" in nginx.conf.

Now you can edit yourfile however often you like without needing to
touch nginx.conf any more, at least until a release upgrade.


Reply to: