comparison xml/en/docs/http/ngx_http_proxy_module.xml @ 3043:9eadb98ec770

Free nginx: removed commercial version documentation.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 14 Feb 2024 20:05:49 +0300
parents 37e082fd009c
children
comparison
equal deleted inserted replaced
3042:19e4897acb84 3043:9eadb98ec770
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9 9
10 <module name="Module ngx_http_proxy_module" 10 <module name="Module ngx_http_proxy_module"
11 link="/en/docs/http/ngx_http_proxy_module.html" 11 link="/en/docs/http/ngx_http_proxy_module.html"
12 lang="en" 12 lang="en"
13 rev="76"> 13 rev="77">
14 14
15 <section id="summary"> 15 <section id="summary">
16 16
17 <para> 17 <para>
18 The <literal>ngx_http_proxy_module</literal> module allows passing 18 The <literal>ngx_http_proxy_module</literal> module allows passing
406 [<literal>manager_files</literal>=<value>number</value>] 406 [<literal>manager_files</literal>=<value>number</value>]
407 [<literal>manager_sleep</literal>=<value>time</value>] 407 [<literal>manager_sleep</literal>=<value>time</value>]
408 [<literal>manager_threshold</literal>=<value>time</value>] 408 [<literal>manager_threshold</literal>=<value>time</value>]
409 [<literal>loader_files</literal>=<value>number</value>] 409 [<literal>loader_files</literal>=<value>number</value>]
410 [<literal>loader_sleep</literal>=<value>time</value>] 410 [<literal>loader_sleep</literal>=<value>time</value>]
411 [<literal>loader_threshold</literal>=<value>time</value>] 411 [<literal>loader_threshold</literal>=<value>time</value>]</syntax>
412 [<literal>purger</literal>=<literal>on</literal>|<literal>off</literal>]
413 [<literal>purger_files</literal>=<value>number</value>]
414 [<literal>purger_sleep</literal>=<value>time</value>]
415 [<literal>purger_threshold</literal>=<value>time</value>]</syntax>
416 <default/> 412 <default/>
417 <context>http</context> 413 <context>http</context>
418 414
419 <para> 415 <para>
420 Sets the path and other parameters of a cache. 416 Sets the path and other parameters of a cache.
456 <para> 452 <para>
457 In addition, all active keys and information about data are stored 453 In addition, all active keys and information about data are stored
458 in a shared memory zone, whose <value>name</value> and <value>size</value> 454 in a shared memory zone, whose <value>name</value> and <value>size</value>
459 are configured by the <literal>keys_zone</literal> parameter. 455 are configured by the <literal>keys_zone</literal> parameter.
460 One megabyte zone can store about 8 thousand keys. 456 One megabyte zone can store about 8 thousand keys.
461 <note>
462 As part of
463 <commercial_version>commercial subscription</commercial_version>,
464 the shared memory zone also stores extended
465 cache <link doc="ngx_http_api_module.xml" id="http_caches_">information</link>,
466 thus, it is required to specify a larger zone size for the same number of keys.
467 For example,
468 one megabyte zone can store about 4 thousand keys.
469 </note>
470 </para> 457 </para>
471 458
472 <para> 459 <para>
473 Cached data that are not accessed during the time specified by the 460 Cached data that are not accessed during the time specified by the
474 <literal>inactive</literal> parameter get removed from the cache 461 <literal>inactive</literal> parameter get removed from the cache
508 Between iterations, a pause configured by the <literal>loader_sleep</literal> 495 Between iterations, a pause configured by the <literal>loader_sleep</literal>
509 parameter (by default, 50 milliseconds) is made. 496 parameter (by default, 50 milliseconds) is made.
510 </para> 497 </para>
511 498
512 <para> 499 <para>
513 Additionally,
514 the following parameters are available as part of our
515 <commercial_version>commercial subscription</commercial_version>:
516 </para>
517
518 <para>
519 <list type="tag">
520
521 <tag-name id="purger">
522 <literal>purger</literal>=<literal>on</literal>|<literal>off</literal>
523 </tag-name>
524 <tag-desc>
525 Instructs whether cache entries that match a
526 <link id="proxy_cache_purge">wildcard key</link>
527 will be removed from the disk by the cache purger (1.7.12).
528 Setting the parameter to <literal>on</literal>
529 (default is <literal>off</literal>)
530 will activate the “cache purger” process that
531 permanently iterates through all cache entries
532 and deletes the entries that match the wildcard key.
533 </tag-desc>
534
535 <tag-name id="purger_files">
536 <literal>purger_files</literal>=<value>number</value>
537 </tag-name>
538 <tag-desc>
539 Sets the number of items that will be scanned during one iteration (1.7.12).
540 By default, <literal>purger_files</literal> is set to 10.
541 </tag-desc>
542
543 <tag-name id="purger_threshold">
544 <literal>purger_threshold</literal>=<value>number</value>
545 </tag-name>
546 <tag-desc>
547 Sets the duration of one iteration (1.7.12).
548 By default, <literal>purger_threshold</literal> is set to 50 milliseconds.
549 </tag-desc>
550
551 <tag-name id="purger_sleep">
552 <literal>purger_sleep</literal>=<value>number</value>
553 </tag-name>
554 <tag-desc>
555 Sets a pause between iterations (1.7.12).
556 By default, <literal>purger_sleep</literal> is set to 50 milliseconds.
557 </tag-desc>
558
559 </list>
560 </para>
561
562 <para>
563 <note> 500 <note>
564 In versions 1.7.3, 1.7.7, and 1.11.10 cache header format has been changed. 501 In versions 1.7.3, 1.7.7, and 1.11.10 cache header format has been changed.
565 Previously cached responses will be considered invalid 502 Previously cached responses will be considered invalid
566 after upgrading to a newer nginx version. 503 after upgrading to a newer nginx version.
567 </note>
568 </para>
569
570 </directive>
571
572
573 <directive name="proxy_cache_purge">
574 <syntax>string ...</syntax>
575 <default/>
576 <context>http</context>
577 <context>server</context>
578 <context>location</context>
579 <appeared-in>1.5.7</appeared-in>
580
581 <para>
582 Defines conditions under which the request will be considered a cache
583 purge request.
584 If at least one value of the string parameters is not empty and is not equal
585 to “0” then the cache entry with a corresponding
586 <link id="proxy_cache_key">cache key</link> is removed.
587 The result of successful operation is indicated by returning
588 the <http-status code="204" text="No Content"/> response.
589 </para>
590
591 <para>
592 If the <link id="proxy_cache_key">cache key</link> of a purge request ends
593 with an asterisk (“<literal>*</literal>”), all cache entries matching the
594 wildcard key will be removed from the cache.
595 However, these entries will remain on the disk until they are deleted
596 for either <link id="proxy_cache_path">inactivity</link>,
597 or processed by the <link id="purger">cache purger</link> (1.7.12),
598 or a client attempts to access them.
599 </para>
600
601 <para>
602 Example configuration:
603 <example>
604 proxy_cache_path /data/nginx/cache keys_zone=cache_zone:10m;
605
606 map $request_method $purge_method {
607 PURGE 1;
608 default 0;
609 }
610
611 server {
612 ...
613 location / {
614 proxy_pass http://backend;
615 proxy_cache cache_zone;
616 proxy_cache_key $uri;
617 proxy_cache_purge $purge_method;
618 }
619 }
620 </example>
621 <note>
622 This functionality is available as part of our
623 <commercial_version>commercial subscription</commercial_version>.
624 </note> 504 </note>
625 </para> 505 </para>
626 506
627 </directive> 507 </directive>
628 508