Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_proxy_module.xml @ 417:cbc2d1b51cb6
Documented the proxy_cookie_domain and proxy_cookie_path directives.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Wed, 15 Feb 2012 21:44:31 +0000 |
parents | 781b23ba3b0a |
children | 695f83494c19 |
comparison
equal
deleted
inserted
replaced
416:c9c0550465c9 | 417:cbc2d1b51cb6 |
---|---|
373 </para> | 373 </para> |
374 | 374 |
375 </directive> | 375 </directive> |
376 | 376 |
377 | 377 |
378 <directive name="proxy_cookie_domain"> | |
379 <syntax><literal>off</literal></syntax> | |
380 <syntax><value>domain</value> <value>replacement</value></syntax> | |
381 <default>off</default> | |
382 <context>http</context> | |
383 <context>server</context> | |
384 <context>location</context> | |
385 <appeared-in>1.1.15</appeared-in> | |
386 | |
387 <para> | |
388 Sets a text that should be changed in the <literal>domain</literal> | |
389 attribute of the <header>Set-Cookie</header> header fields of a | |
390 proxied server response. | |
391 Suppose a proxied server returned the header field | |
392 <header>Set-Cookie</header> with the attribute | |
393 “<literal>domain=localhost</literal>”. | |
394 The directive | |
395 <example> | |
396 proxy_cookie_domain localhost example.org; | |
397 </example> | |
398 will rewrite this attribute to | |
399 “<literal>domain=example.org</literal>”. | |
400 </para> | |
401 | |
402 <para> | |
403 A dot at the beginning of the <value>domain</value> and | |
404 <value>replacement</value> strings, and the <literal>domain</literal> | |
405 attribute is ignored. | |
406 Matching is case-insensitive. | |
407 </para> | |
408 | |
409 <para> | |
410 The strings <value>domain</value> and <value>replacement</value> | |
411 can contain variables: | |
412 <example> | |
413 proxy_cookie_domain www.$host $host; | |
414 </example> | |
415 </para> | |
416 | |
417 <para> | |
418 A directive can also be specified using regular expressions. | |
419 In this case, <value>domain</value> should start from | |
420 the “<literal>~</literal>” symbol. | |
421 A regular expression can contain named and positional captures, | |
422 and <value>replacement</value> can reference them: | |
423 <example> | |
424 proxy_cookie_domain ~\.(?P<sl_domain>[-0-9a-z]+\.[a-z]+)$ $sl_domain; | |
425 </example> | |
426 </para> | |
427 | |
428 <para> | |
429 There could be several <literal>proxy_cookie_domain</literal> directives: | |
430 <example> | |
431 proxy_cookie_domain localhost example.org; | |
432 proxy_cookie_domain ~\.([a-z]+\.[a-z]+)$ $1; | |
433 </example> | |
434 </para> | |
435 | |
436 <para> | |
437 The <literal>off</literal> parameter cancels all | |
438 <literal>proxy_cookie_domain</literal> directives on the current level: | |
439 <example> | |
440 proxy_cookie_domain off; | |
441 proxy_cookie_domain localhost example.org; | |
442 proxy_cookie_domain www.example.org example.org; | |
443 </example> | |
444 </para> | |
445 | |
446 </directive> | |
447 | |
448 | |
449 <directive name="proxy_cookie_path"> | |
450 <syntax><literal>off</literal></syntax> | |
451 <syntax><value>path</value> <value>replacement</value></syntax> | |
452 <default>off</default> | |
453 <context>http</context> | |
454 <context>server</context> | |
455 <context>location</context> | |
456 <appeared-in>1.1.15</appeared-in> | |
457 | |
458 <para> | |
459 Sets a text that should be changed in the <literal>path</literal> | |
460 attribute of the <header>Set-Cookie</header> header fields of a | |
461 proxied server response. | |
462 Suppose a proxied server returned the header field | |
463 <header>Set-Cookie</header> with the attribute | |
464 “<literal>path=/two/some/uri/</literal>”. | |
465 The directive | |
466 <example> | |
467 proxy_cookie_path /two/ /; | |
468 </example> | |
469 will rewrite this attribute to | |
470 “<literal>path=/some/uri/</literal>”. | |
471 </para> | |
472 | |
473 <para> | |
474 The strings <value>path</value> and <value>replacement</value> | |
475 can contain variables: | |
476 <example> | |
477 proxy_cookie_path $uri /some$uri; | |
478 </example> | |
479 </para> | |
480 | |
481 <para> | |
482 A directive can also be specified using regular expressions. | |
483 In this case, <value>path</value> should either start from | |
484 the “<literal>~</literal>” symbol for a case-sensitive matching, | |
485 or from the “<literal>~*</literal>” symbols for case-insensitive | |
486 matching. | |
487 A regular expression can contain named and positional captures, | |
488 and <value>replacement</value> can reference them: | |
489 <example> | |
490 proxy_cookie_path ~*^/user/([^/]+) /u/$1; | |
491 </example> | |
492 </para> | |
493 | |
494 <para> | |
495 There could be several <literal>proxy_cookie_path</literal> directives: | |
496 <example> | |
497 proxy_cookie_path /one/ /; | |
498 proxy_cookie_path / /two/; | |
499 </example> | |
500 </para> | |
501 | |
502 <para> | |
503 The <literal>off</literal> parameter cancels all | |
504 <literal>proxy_cookie_path</literal> directives on the current level: | |
505 <example> | |
506 proxy_cookie_path off; | |
507 proxy_cookie_path /two/ /; | |
508 proxy_cookie_path ~*^/user/([^/]+) /u/$1; | |
509 </example> | |
510 </para> | |
511 | |
512 </directive> | |
513 | |
514 | |
378 <directive name="proxy_hide_header"> | 515 <directive name="proxy_hide_header"> |
379 <syntax><value>field</value></syntax> | 516 <syntax><value>field</value></syntax> |
380 <default/> | 517 <default/> |
381 <context>http</context> | 518 <context>http</context> |
382 <context>server</context> | 519 <context>server</context> |
784 </example> | 921 </example> |
785 </para> | 922 </para> |
786 | 923 |
787 <para> | 924 <para> |
788 A directive can be specified (1.1.11) using regular expressions. | 925 A directive can be specified (1.1.11) using regular expressions. |
789 In this case, <value>replacement</value> should either start from | 926 In this case, <value>redirect</value> should either start from |
790 the “<literal>~</literal>” symbol for a case-sensitive matching, | 927 the “<literal>~</literal>” symbol for a case-sensitive matching, |
791 or from the “<literal>~*</literal>” symbols for case-insensitive | 928 or from the “<literal>~*</literal>” symbols for case-insensitive |
792 matching. | 929 matching. |
793 A regular expression can contain named and positional captures, | 930 A regular expression can contain named and positional captures, |
794 and <value>replacement</value> can reference them: | 931 and <value>replacement</value> can reference them: |