From 24e12da9660df360895b75db2394615f118ed032 Mon Sep 17 00:00:00 2001 From: Yaroslav Zhuravlev Date: Thu, 18 Sep 2025 11:28:45 +0100 Subject: [PATCH 1/3] fix: remove ASCII value of NSBP --- .../basic-functionality/managing-configuration-files.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md b/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md index 1032e68d1..ab489fc6b 100644 --- a/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md +++ b/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md @@ -9,9 +9,9 @@ type: - how-to --- -Similar to other services, NGINX and NGINX Plus use a text‑based configuration file with a precise format. By default the file is named **nginx.conf** and for NGINX Plus is placed in the `/etc/nginx` directory. +Similar to other services, NGINX and NGINX Plus use a text‑based configuration file with a precise format. By default the file is named **nginx.conf** and for NGINX Plus is placed in the `/etc/nginx` directory. -For NGINX Open Source, the location depends on the package system used to install NGINX and the operating system. It is typically one of `/usr/local/nginx/conf`, `/etc/nginx`, or `/usr/local/etc/nginx`. +For NGINX Open Source, the location depends on the package system used to install NGINX and the operating system. It is typically one of `/usr/local/nginx/conf`, `/etc/nginx`, or `/usr/local/etc/nginx`. ## Directives The configuration file consists of _directives_ and their parameters. Simple (single‑line) directives end with a semicolon ( `;` ). Other directives act as “containers” which group together related directives. Containers are enclosed in curly braces ( `{}` ) and are often referred to as _blocks_. Here are some examples of simple directives. @@ -89,10 +89,10 @@ stream { ### Inheritance -In general, a _child_ context – a context contained within another context (its _parent_) – inherits the settings of directives included at the parent level. Some directives can appear in multiple contexts, in which case you can override the setting inherited from the parent by including the directive in the child context. For an example, see the [proxy_set_header](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header) directive. +In general, a _child_ context – a context contained within another context (its _parent_) – inherits the settings of directives included at the parent level. Some directives can appear in multiple contexts, in which case you can override the setting inherited from the parent by including the directive in the child context. For an example, see the [proxy_set_header](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header) directive. ## Reload Configuration File For changes to the configuration file to take effect, it must be reloaded. You can either restart the `nginx` process or send the `reload` signal to upgrade the configuration without interrupting the processing of current requests. For details, see [Control NGINX Processes at Runtime]({{< ref "/nginx/admin-guide/basic-functionality/runtime-control.md" >}}). -With NGINX Plus, you can dynamically reconfigure [load balancing]({{< ref "/nginx/admin-guide/load-balancer/dynamic-configuration-api.md" >}}) across the servers in an upstream group without reloading the configuration. You can also use the NGINX Plus API and key‑value store to dynamically control access, for example [based on client IP address]({{< ref "/nginx/admin-guide/security-controls/denylisting-ip-addresses.md" >}}). +With NGINX Plus, you can dynamically reconfigure [load balancing]({{< ref "/nginx/admin-guide/load-balancer/dynamic-configuration-api.md" >}}) across the servers in an upstream group without reloading the configuration. You can also use the NGINX Plus API and key‑value store to dynamically control access, for example [based on client IP address]({{< ref "/nginx/admin-guide/security-controls/denylisting-ip-addresses.md" >}}). From 486c01cce310ac5ad9a0ae8bd5901e75b1ca10b7 Mon Sep 17 00:00:00 2001 From: Yaroslav Zhuravlev Date: Thu, 18 Sep 2025 11:30:24 +0100 Subject: [PATCH 2/3] fix: sentence-case --- .../basic-functionality/managing-configuration-files.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md b/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md index ab489fc6b..c32c3d44b 100644 --- a/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md +++ b/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md @@ -22,7 +22,7 @@ error_log logs/error.log notice; worker_processes 1; ``` -## Feature-Specific Configuration Files +## Feature-specific configuration files To make the configuration easier to maintain, we recommend that you split it into a set of feature‑specific files stored in the **/etc/nginx/conf.d** directory and use the [include](https://nginx.org/en/docs/ngx_core_module.html#include) directive in the main **nginx.conf** file to reference the contents of the feature‑specific files. @@ -43,14 +43,15 @@ A few top‑level directives, referred to as _contexts_, group together the dire Directives placed outside of these contexts are said to be in the _main_ context. -### Virtual Servers +### Virtual servers + In each of the traffic‑handling contexts, you include one or more `server` blocks to define _virtual servers_ that control the processing of requests. The directives you can include within a `server` context vary depending on the traffic type. For HTTP traffic (the `http` context), each [server](https://nginx.org/en/docs/http/ngx_http_core_module.html#server) directive controls the processing of requests for resources at particular domains or IP addresses. One or more [location](https://nginx.org/en/docs/http/ngx_http_core_module.html#location) contexts within a `server` context define how to process specific sets of URIs. For mail and TCP/UDP traffic (the [mail](https://nginx.org/en/docs/mail/ngx_mail_core_module.html) and [stream](https://nginx.org/en/docs/stream/ngx_stream_core_module.html) contexts) the `server` directives each control the processing of traffic arriving at a particular TCP port or UNIX socket. -### Sample Configuration File with Multiple Contexts +### Sample configuration file with multiple contexts The following configuration illustrates the use of contexts. @@ -91,7 +92,7 @@ stream { In general, a _child_ context – a context contained within another context (its _parent_) – inherits the settings of directives included at the parent level. Some directives can appear in multiple contexts, in which case you can override the setting inherited from the parent by including the directive in the child context. For an example, see the [proxy_set_header](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header) directive. -## Reload Configuration File +## Reload configuration file For changes to the configuration file to take effect, it must be reloaded. You can either restart the `nginx` process or send the `reload` signal to upgrade the configuration without interrupting the processing of current requests. For details, see [Control NGINX Processes at Runtime]({{< ref "/nginx/admin-guide/basic-functionality/runtime-control.md" >}}). From 342c5ed1e895211d069c88b5120226aec146f5e2 Mon Sep 17 00:00:00 2001 From: Yaroslav Zhuravlev Date: Thu, 18 Sep 2025 12:24:14 +0100 Subject: [PATCH 3/3] fix: add FreeBSD path and --conf-path. --- .../managing-configuration-files.md | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md b/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md index c32c3d44b..e9ca8cab7 100644 --- a/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md +++ b/content/nginx/admin-guide/basic-functionality/managing-configuration-files.md @@ -9,11 +9,33 @@ type: - how-to --- -Similar to other services, NGINX and NGINX Plus use a text‑based configuration file with a precise format. By default the file is named **nginx.conf** and for NGINX Plus is placed in the `/etc/nginx` directory. +NGINX and NGINX Plus use a text‑based configuration file, by default named **nginx.conf**. -For NGINX Open Source, the location depends on the package system used to install NGINX and the operating system. It is typically one of `/usr/local/nginx/conf`, `/etc/nginx`, or `/usr/local/etc/nginx`. +NGINX Plus: default location is `/etc/nginx` for Linux or `/usr/local/etc/nginx` for FreeBSD. + +NGINX Open Source: location depends on the package system used to install NGINX and the operating system. It is typically one of `/usr/local/nginx/conf`, `/etc/nginx`, or `/usr/local/etc/nginx`. + +You can verify the exact configuration file path with the `--conf-path=` parameter in the output of the `nginx -V` command: + +```shell + nginx -V 2>&1 | awk -F: '/configure arguments/ {print $2}' | xargs -n1 +``` + +Sample output: + +```none +--prefix=/etc/nginx +--sbin-path=/usr/sbin/nginx +--modules-path=/usr/lib64/nginx/modules +--conf-path=/etc/nginx/nginx.conf # The path to your config file +--error-log-path=/var/log/nginx/error.log +--http-log-path=/var/log/nginx/access.log +--pid-path=/var/run/nginx.pid +--... +``` ## Directives + The configuration file consists of _directives_ and their parameters. Simple (single‑line) directives end with a semicolon ( `;` ). Other directives act as “containers” which group together related directives. Containers are enclosed in curly braces ( `{}` ) and are often referred to as _blocks_. Here are some examples of simple directives. ```nginx @@ -24,7 +46,7 @@ worker_processes 1; ## Feature-specific configuration files -To make the configuration easier to maintain, we recommend that you split it into a set of feature‑specific files stored in the **/etc/nginx/conf.d** directory and use the [include](https://nginx.org/en/docs/ngx_core_module.html#include) directive in the main **nginx.conf** file to reference the contents of the feature‑specific files. +To make the configuration easier to maintain, it is possible to split it into a set of feature‑specific files stored in the `/etc/nginx/conf.d` directory and use the [include](https://nginx.org/en/docs/ngx_core_module.html#include) directive in the main **nginx.conf** file to reference the contents of the feature‑specific files. ```nginx include conf.d/http;