# HG changeset patch # User Ruslan Ermilov # Date 1329342271 0 # Node ID cbc2d1b51cb6db797a72183db3e13e7372fd09ea # Parent c9c0550465c94aed73deb6bca96809a9e70c53be Documented the proxy_cookie_domain and proxy_cookie_path directives. diff -r c9c0550465c9 -r cbc2d1b51cb6 xml/en/docs/http/ngx_http_proxy_module.xml --- a/xml/en/docs/http/ngx_http_proxy_module.xml Wed Feb 15 14:45:05 2012 +0000 +++ b/xml/en/docs/http/ngx_http_proxy_module.xml Wed Feb 15 21:44:31 2012 +0000 @@ -375,6 +375,143 @@ + +off +domain replacement +off +http +server +location +1.1.15 + + +Sets a text that should be changed in the domain +attribute of the
Set-Cookie
header fields of a +proxied server response. +Suppose a proxied server returned the header field +
Set-Cookie
with the attribute +“domain=localhost”. +The directive + +proxy_cookie_domain localhost example.org; + +will rewrite this attribute to +“domain=example.org”. +
+ + +A dot at the beginning of the domain and +replacement strings, and the domain +attribute is ignored. +Matching is case-insensitive. + + + +The strings domain and replacement +can contain variables: + +proxy_cookie_domain www.$host $host; + + + + +A directive can also be specified using regular expressions. +In this case, domain should start from +the “~” symbol. +A regular expression can contain named and positional captures, +and replacement can reference them: + +proxy_cookie_domain ~\.(?P<sl_domain>[-0-9a-z]+\.[a-z]+)$ $sl_domain; + + + + +There could be several proxy_cookie_domain directives: + +proxy_cookie_domain localhost example.org; +proxy_cookie_domain ~\.([a-z]+\.[a-z]+)$ $1; + + + + +The off parameter cancels all +proxy_cookie_domain directives on the current level: + +proxy_cookie_domain off; +proxy_cookie_domain localhost example.org; +proxy_cookie_domain www.example.org example.org; + + + +
+ + + +off +path replacement +off +http +server +location +1.1.15 + + +Sets a text that should be changed in the path +attribute of the
Set-Cookie
header fields of a +proxied server response. +Suppose a proxied server returned the header field +
Set-Cookie
with the attribute +“path=/two/some/uri/”. +The directive + +proxy_cookie_path /two/ /; + +will rewrite this attribute to +“path=/some/uri/”. +
+ + +The strings path and replacement +can contain variables: + +proxy_cookie_path $uri /some$uri; + + + + +A directive can also be specified using regular expressions. +In this case, path should either start from +the “~” symbol for a case-sensitive matching, +or from the “~*” symbols for case-insensitive +matching. +A regular expression can contain named and positional captures, +and replacement can reference them: + +proxy_cookie_path ~*^/user/([^/]+) /u/$1; + + + + +There could be several proxy_cookie_path directives: + +proxy_cookie_path /one/ /; +proxy_cookie_path / /two/; + + + + +The off parameter cancels all +proxy_cookie_path directives on the current level: + +proxy_cookie_path off; +proxy_cookie_path /two/ /; +proxy_cookie_path ~*^/user/([^/]+) /u/$1; + + + +
+ + field @@ -786,7 +923,7 @@ A directive can be specified (1.1.11) using regular expressions. -In this case, replacement should either start from +In this case, redirect should either start from the “~” symbol for a case-sensitive matching, or from the “~*” symbols for case-insensitive matching. diff -r c9c0550465c9 -r cbc2d1b51cb6 xml/ru/docs/http/ngx_http_proxy_module.xml --- a/xml/ru/docs/http/ngx_http_proxy_module.xml Wed Feb 15 14:45:05 2012 +0000 +++ b/xml/ru/docs/http/ngx_http_proxy_module.xml Wed Feb 15 21:44:31 2012 +0000 @@ -374,6 +374,142 @@ + +off +домен замена +off +http +server +location +1.1.15 + + +Задаёт текст, который нужно изменить в атрибуте domain +полей
Set-Cookie
заголовка ответа проксируемого сервера. +Предположим, проксируемый сервер вернул поле заголовка +
Set-Cookie
с атрибутом +“domain=localhost”. +Директива + +proxy_cookie_domain localhost example.org; + +перепишет данный атрибут в виде +“domain=example.org”. +
+ + +Точка в начале строк домен и замена, +а равно как и в атрибуте domain игнорируется. +Регистр значения не имеет. + + + +В строках домен и замена можно использовать +переменные: + +proxy_cookie_domain www.$host $host; + + + + +Директиву также можно задать при помощи регулярных выражений. +При этом домен должен начинаться с символа +“~”. +Регулярное выражение может содержать именованные и позиционные выделения, +а замена ссылаться на них: + +proxy_cookie_domain ~\.(?P<sl_domain>[-0-9a-z]+\.[a-z]+)$ $sl_domain; + + + + +Директив proxy_cookie_domain может быть несколько: + +proxy_cookie_domain localhost example.org; +proxy_cookie_domain ~\.([a-z]+\.[a-z]+)$ $1; + + + + +Параметр off запрещает все директивы +proxy_cookie_domain +на данном уровне: + +proxy_cookie_domain off; +proxy_cookie_domain localhost example.org; +proxy_cookie_domain www.example.org example.org; + + + +
+ + + +off +путь замена +off +http +server +location +1.1.15 + + +Задаёт текст, который нужно изменить в атрибуте path +полей
Set-Cookie
заголовка ответа проксируемого сервера. +Предположим, проксируемый сервер вернул поле заголовка +
Set-Cookie
с атрибутом +“path=/two/some/uri/”. +Директива + +proxy_cookie_path /two/ /; + +перепишет данный атрибут в виде +“path=/some/uri/”. +
+ + +В строках путь и замена можно использовать +переменные: + +proxy_cookie_path $uri /some$uri; + + + + +Директиву также можно задать при помощи регулярных выражений. +При этом путь должен начинаться либо с символа +“~”, если при сравнении следует учитывать регистр символов, +либо с символов “~*”, если регистр символов учитывать +не нужно. +Регулярное выражение может содержать именованные и позиционные выделения, +а замена ссылаться на них: + +proxy_cookie_path ~*^/user/([^/]+) /u/$1; + + + + +Директив proxy_cookie_path может быть несколько: + +proxy_cookie_path /one/ /; +proxy_cookie_path / /two/; + + + + +Параметр off запрещает все директивы +proxy_cookie_path +на данном уровне: + +proxy_cookie_path off; +proxy_cookie_path /two/ /; +proxy_cookie_path ~*^/user/([^/]+) /u/$1; + + + +
+ + поле