# HG changeset patch # User Ruslan Ermilov # Date 1330521922 0 # Node ID 3a9f39341c7c56e41e4549ff26713195c903787a # Parent 338c5aa982f8f954c37d8609240863308283f4a5 - Documented the "from" parameter of the "disable_symlinks" directive, and that read permissions on intermediate directories are no longer required on OSes that support opening directories for searching. - Improved documentation of $document_root and $realpath_root. diff -r 338c5aa982f8 -r 3a9f39341c7c xml/en/docs/http/ngx_http_core_module.xml --- a/xml/en/docs/http/ngx_http_core_module.xml Wed Feb 29 10:56:18 2012 +0000 +++ b/xml/en/docs/http/ngx_http_core_module.xml Wed Feb 29 13:25:22 2012 +0000 @@ -465,10 +465,11 @@ +off on | - off | - if_not_owner + if_not_owner + [from=prefix] off http server @@ -476,12 +477,12 @@ 1.1.15 -Determines how nginx treats symbolic links when opening files: +Determines how symbolic links should be treated when opening files: off -Symbolic links in the pathname are not processed specially. +Symbolic links in the pathname are allowed and not checked. This is the default behavior. @@ -498,10 +499,31 @@ points to have different owners. +from=prefix + +When checking symbolic links +(parameters on and if_not_owner), +each component of the pathname is normally checked. +If however the +from=prefix is also given, +symbolic links are checked only from the component of the pathname +specified by prefix. +The prefix value can contain variables. +If a value is not a prefix of the checked pathname, the whole +pathname is checked as if this parameter was not specified at all. + + +Example: + +disable_symlinks on from=$document_root; + + + + This directive is only available on systems that have the openat and fstatat interfaces. This includes modern versions of FreeBSD, Linux, and Solaris. @@ -510,10 +532,12 @@ Parameters on and if_not_owner add a processing overhead. -Furthermore, + +On systems that do not support opening directories for search only, the use of these parameters requires that worker processes be able to read all intermediate directories. + @@ -2565,7 +2589,8 @@ $document_root - directive's value for the current request + or directive's value +for the current request $document_uri @@ -2624,8 +2649,10 @@ $realpath_root - directive's value -for the current request, with all symbolic links resolved to real paths +an absolute pathname corresponding to the + or directive's value +for the current request, +with all symbolic links resolved to real paths $remote_addr diff -r 338c5aa982f8 -r 3a9f39341c7c xml/ru/docs/http/ngx_http_core_module.xml --- a/xml/ru/docs/http/ngx_http_core_module.xml Wed Feb 29 10:56:18 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_core_module.xml Wed Feb 29 13:25:22 2012 +0000 @@ -454,10 +454,11 @@ +off on | - off | - if_not_owner + if_not_owner + [from=префикс] off http server @@ -471,7 +472,7 @@ off -Символические ссылки в пути никак специально не обрабатываются. +Символические ссылки в пути допускаются и не проверяются. Это стандартное поведение. @@ -484,14 +485,35 @@ if_not_owner Доступ к файлу запрещается, если любой компонент пути -является символической ссылкой, и ссылка и объект, на +является символической ссылкой, а ссылка и объект, на который она ссылается, имеют разных владельцев. +from=префикс + +При проверке символических ссылок +(параметры on и if_not_owner) +обычно проверяется каждый элемент пути. +Однако если дополнительно указан параметр +from=префикс, +символические ссылки проверяются лишь начиная с элемента пути, +заданного префиксом. +В значении префикса можно использовать переменные. +Если значение не является префиксом проверяемого пути, +путь проверяется целиком, как если бы этот параметр не был указан вовсе. + + +Пример: + +disable_symlinks on from=$document_root; + + + + Эта директива доступна только на системах, в которых есть интерфейсы openat и fstatat. К таким системам относятся современные версии FreeBSD, Linux и Solaris. @@ -500,10 +522,13 @@ Параметры on и if_not_owner требуют дополнительных затрат на обработку. -Кроме того, + +На системах, не поддерживающих операцию открытия каталогов только для поиска, использование этих параметров требует, чтобы рабочие процессы имели возможность читать все промежуточные каталоги. + + @@ -2552,7 +2577,8 @@ $document_root -значение директивы для текущего запроса +значение директивы или +для текущего запроса $document_uri @@ -2611,8 +2637,10 @@ $realpath_root -значение директивы для текущего запроса, -при этом все символические ссылки преобразованы в реальные путь +абсолютный путь, соответствующий +значению директивы или +для текущего запроса, +в котором все символические ссылки преобразованы в реальные пути $remote_addr