? ? ? ? 本篇文章主要讲ngx_http_proxy_module模块下各指令的使用方法。
Syntax:? ? ?proxy_bind address [transparent] | off;
Default:? ? ?—
Context:?? ?http, server, location
This directive appeared in version 0.8.22.
Syntax:? ? ?proxy_buffer_size size;
Default:? ? ?proxy_buffer_size 4k|8k;
Context:?? ?http, server, location
Syntax:? ? ?proxy_buffering on | off;
Default:? ? ?proxy_buffering on;
Context:?? ?http, server, location
Syntax:? ? ?proxy_buffers number size;
Default:? ? ?proxy_buffers 8 4k|8k;
Context:?? ?http, server, location
Syntax:? ? ?proxy_busy_buffers_size size;
Default:? ? ?proxy_busy_buffers_size 8k|16k;
Context:?? ?http, server, location
Syntax:?? ?proxy_cache zone | off;
Default:?? ?proxy_cache off;
Context:?? ?http, server, location
Syntax:?? ?proxy_cache_background_update on | off;
Default:?? ?proxy_cache_background_update off;
Context:?? ?http, server, location
This directive appeared in version 1.11.10.
Syntax:?? ?proxy_cache_bypass string ...;
Default:?? ?—
Context:?? ?http, server, location
Syntax:?? ?proxy_cache_convert_head on | off;
Default:?? ?proxy_cache_convert_head on;
Context:?? ?http, server, location
This directive appeared in version 1.9.7.
Syntax:?? ?proxy_cache_key string;
Default:?? ?proxy_cache_key $scheme$proxy_host$request_uri;
Context:?? ?http, server, location
Syntax:?? ?proxy_cache_lock on | off;
Default:?? ?proxy_cache_lock off;
Context:?? ?http, server, location
This directive appeared in version 1.1.12.
Syntax:?? ?proxy_cache_lock_age time;
Default:?? ?proxy_cache_lock_age 5s;
Context:?? ?http, server, location
This directive appeared in version 1.7.8.
Syntax:?? ?proxy_cache_lock_timeout time;
Default:?? ?proxy_cache_lock_timeout 5s;
Context:?? ?http, server, location
This directive appeared in version 1.1.12.
Syntax:?? ?proxy_cache_max_range_offset number;
Default:?? ?—
Context:?? ?http, server, location
This directive appeared in version 1.11.6.
Syntax:?? ?proxy_cache_methods GET | HEAD | POST ...;
Default:?? ?proxy_cache_methods GET HEAD;
Context:?? ?http, server, location
This directive appeared in version 0.7.59.
Syntax:?? ?proxy_cache_min_uses number;
Default:?? ?proxy_cache_min_uses 1;
Context:?? ?http, server, location
Syntax:?? ?proxy_cache_path path [levels=levels] [use_temp_path=on|off] keys_zone=name:size [inactive=time] [max_size=size] [min_free=size] [manager_files=number] [manager_sleep=time] [manager_threshold=time] [loader_files=number] [loader_sleep=time] [loader_threshold=time] [purger=on|off] [purger_files=number] [purger_sleep=time] [purger_threshold=time];
Default:?? ?—
Context:?? ?http
Syntax:?? ?proxy_cache_purge string ...;
Default:?? ?—
Context:?? ?http, server, location
This directive appeared in version 1.5.7.
Syntax:?? ?proxy_cache_revalidate on | off;
Default:?? ?proxy_cache_revalidate off;
Context:?? ?http, server, location
This directive appeared in version 1.5.7.
Syntax:?? ?proxy_cache_use_stale error | timeout | invalid_header | updating | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429 | off ...;
Default:???proxy_cache_use_stale off;
Context:?? ?http, server, location
Syntax:?? ?proxy_cache_valid [code ...] time;
Default:?? ?—
Context:?? ?http, server, location
Syntax:?? ?proxy_connect_timeout time;
Default:?? ?proxy_connect_timeout 60s;
Context:?? ?http, server, location
Syntax:?? ?proxy_cookie_flags off | cookie [flag ...];
Default:?? ?proxy_cookie_flags off;
Context:?? ?http, server, location
This directive appeared in version 1.19.3.
Syntax:?? ?proxy_cookie_flags off | cookie [flag ...];
Default:?? ?
proxy_cookie_flags off;
Context:?? ?http, server, location
This directive appeared in version 1.19.3.
Syntax:?? ?proxy_cookie_path off;
????????????????proxy_cookie_path path replacement;
Default:?? ?proxy_cookie_path off;
Context:?? ?http, server, location
This directive appeared in version 1.1.15.
Syntax:?? ?proxy_force_ranges on | off;
Default:?? ?proxy_force_ranges off;
Context:?? ?http, server, location
This directive appeared in version 1.7.7.
Syntax:?? ?proxy_headers_hash_bucket_size size;
Default:?? ?proxy_headers_hash_bucket_size 64;
Context:?? ?http, server, location
Syntax:?? ?proxy_headers_hash_max_size size;
Default:?? ?proxy_headers_hash_max_size 512;
Context:?? ?http, server, location
Syntax:?? ?proxy_hide_header field;
Default:?? ?—
Context:?? ?http, server, location
Syntax:?? ?proxy_http_version 1.0 | 1.1;
Default:?? ?proxy_http_version 1.0;
Context:?? ?http, server, location
This directive appeared in version 1.1.4.
Syntax:?? ?proxy_ignore_client_abort on | off;
Default:?? ?proxy_ignore_client_abort off;
Context:?? ?http, server, location
Syntax:?? ?proxy_ignore_headers field ...;
Default:?? ?—
Context:?? ?http, server, location
Syntax:?? ?proxy_intercept_errors on | off;
Default:?? ?proxy_intercept_errors off;
Context:?? ?http, server, location
Syntax:?? ?proxy_limit_rate rate;
Default:?? ?proxy_limit_rate 0;
Context:?? ?http, server, location
This directive appeared in version 1.7.7.
Syntax:?? ?proxy_max_temp_file_size size;
Default:?? ?proxy_max_temp_file_size 1024m;
Context:?? ?http, server, location
Syntax:?? ?proxy_method method;
Default:?? ?—
Context:?? ?http, server, location
Syntax:?? ?proxy_next_upstream error | timeout | invalid_header | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429 | non_idempotent | off ...;
Default:?? ?proxy_next_upstream error timeout;
Context:?? ?http, server, location
Syntax:?? ?proxy_next_upstream_timeout time;
Default:?? ?proxy_next_upstream_timeout 0;
Context:?? ?http, server, location
This directive appeared in version 1.7.5.
Syntax:?? ?proxy_next_upstream_tries number;
Default:?? ?proxy_next_upstream_tries 0;
Context:?? ?http, server, location
This directive appeared in version 1.7.5.
Syntax:?? ?proxy_no_cache string ...;
Default:?? ?—
Context:?? ?http, server, location
Syntax:?? ?proxy_pass URL;
Default:?? ?—
Context:?? ?location, if in location, limit_except
Syntax:?? ?proxy_pass_header field;
Default:?? ?—
Context:?? ?http, server, location
Syntax:?? ?proxy_pass_request_body on | off;
Default:?? ?proxy_pass_request_body on;
Context:?? ?http, server, location
Syntax:?? ?proxy_pass_request_headers on | off;
Default:?? ?proxy_pass_request_headers on;
Context:?? ?http, server, location
Syntax:?? ?proxy_read_timeout time;
Default:?? ?proxy_read_timeout 60s;
Context:?? ?http, server, location
Syntax:?? ?proxy_redirect default;
????????????????proxy_redirect off;
????????????????proxy_redirect redirect replacement;
Default:?? ?proxy_redirect default;
Context:?? ?http, server, location
Syntax:?? ?proxy_request_buffering on | off;
Default:?? ?proxy_request_buffering on;
Context:?? ?http, server, location
This directive appeared in version 1.7.11.
Syntax:?? ?proxy_send_lowat size;
Default:?? ?proxy_send_lowat 0;
Context:?? ?http, server, location
Syntax:?? ?proxy_send_timeout time;
Default:?? ?proxy_send_timeout 60s;
Context:?? ?http, server, location
Syntax:?? ?proxy_set_body value;
Default:?? ?—
Context:?? ?http, server, location
Syntax:?? ?proxy_set_header field value;
Default:?? ?proxy_set_header Host $proxy_host;
? ? ? ? ? ? ? ? ?proxy_set_header Connection close;
Context:?? ?http, server, location
Syntax:?? ?proxy_socket_keepalive on | off;
Default:?? ?proxy_socket_keepalive off;
Context:?? ?http, server, location
This directive appeared in version 1.15.6.
Syntax:?? ?proxy_ssl_certificate file;
Default:?? ?—
Context:?? ?http, server, location
This directive appeared in version 1.7.8.
Syntax:?? ?proxy_ssl_certificate_key file;
Default:?? ?—
Context:?? ?http, server, location
This directive appeared in version 1.7.8.
Syntax:?? ?proxy_ssl_ciphers ciphers;
Default:?? ?proxy_ssl_ciphers DEFAULT;
Context:?? ?http, server, location
This directive appeared in version 1.5.6.
Syntax:?? ?proxy_ssl_conf_command name value;
Default:?? ?—
Context:?? ?http, server, location
This directive appeared in version 1.19.4.
Syntax:?? ?proxy_ssl_crl file;
Default:?? ?—
Context:?? ?http, server, location
This directive appeared in version 1.7.0.
Syntax:?? ?proxy_ssl_name name;
Default:?? ?proxy_ssl_name $proxy_host;
Context:?? ?http, server, location
This directive appeared in version 1.7.0.
Syntax:?? ?proxy_ssl_password_file file;
Default:?? ?—
Context:?? ?http, server, location
This directive appeared in version 1.7.8.
Syntax:?? ?proxy_ssl_protocols [SSLv2] [SSLv3] [TLSv1] [TLSv1.1] [TLSv1.2] [TLSv1.3];
Default:?? ?proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
Context:?? ?http, server, location
This directive appeared in version 1.5.6.
Syntax:?? ?proxy_ssl_server_name on | off;
Default:?? ?proxy_ssl_server_name off;
Context:?? ?http, server, location
This directive appeared in version 1.7.0.
Syntax:?? ?proxy_ssl_session_reuse on | off;
Default:?? ?proxy_ssl_session_reuse on;
Context:?? ?http, server, location
Syntax:?? ?proxy_ssl_trusted_certificate file;
Default:?? ?—
Context:?? ?http, server, location
This directive appeared in version 1.7.0.
Syntax:?? ?proxy_ssl_verify on | off;
Default:?? ?proxy_ssl_verify off;
Context:?? ?http, server, location
This directive appeared in version 1.7.0.
Syntax:?? ?proxy_ssl_verify_depth number;
Default:?? ?proxy_ssl_verify_depth 1;
Context:?? ?http, server, location
This directive appeared in version 1.7.0.
Syntax:?? ?proxy_store on | off | string;
Default:?? ?proxy_store off;
Context:?? ?http, server, location
Syntax:?? ?proxy_store_access users:permissions ...;
Default:?? ?proxy_store_access user:rw;
Context:?? ?http, server, location
Syntax:?? ?proxy_temp_file_write_size size;
Default:?? ?proxy_temp_file_write_size 8k|16k;
Context:?? ?http, server, location
Syntax:?? ?proxy_temp_path path [level1 [level2 [level3]]];
Default:?? ?proxy_temp_path proxy_temp;
Context:?? ?http, server, location