ngx_http_proxy_module

location / {
    proxy_pass       http://localhost:8000;
    proxy_set_header Host      $host;
    proxy_set_header X-Real-IP $remote_addr;
}

proxy_bind address [transparent] | off; 從這個(gè)指定的地址轉(zhuǎn)發(fā)到被代理的服務(wù)器

proxy_buffer_size size;
proxy_buffering on | off;
proxy_buffers number size;
proxy_busy_buffers_size size;
proxy_cache zone | off;
proxy_cache_background_update on | off;
proxy_cache_bypass string ...;
proxy_cache_convert_head on | off;
proxy_cache_key string;
proxy_cache_lock on | off;
proxy_cache_lock_age time;
proxy_cache_lock_timeout time;
proxy_cache_max_range_offset number;
proxy_cache_methods GET | HEAD | POST ...;
proxy_cache_min_uses number;
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];
proxy_cache_purge string ...;
proxy_cache_revalidate on | off;
proxy_cache_use_stale error | timeout | invalid_header | updating | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429 | off ...;
proxy_cache_valid [code ...] time;

proxy_connect_timeout time; 連接到被代理服務(wù)器的超時(shí)時(shí)間

proxy_cookie_domain off;
proxy_cookie_domain domain replacement;
proxy_cookie_flags off | cookie [flag ...];
proxy_cookie_path off;
proxy_cookie_path path replacement;
proxy_force_ranges on | off;
proxy_headers_hash_bucket_size size;
proxy_headers_hash_max_size size;
proxy_hide_header field;
proxy_http_version 1.0 | 1.1;
proxy_ignore_client_abort on | off;
proxy_ignore_headers field ...;
proxy_intercept_errors on | off;
proxy_limit_rate rate;
proxy_max_temp_file_size size;
proxy_method method;
proxy_next_upstream error | timeout | invalid_header | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429 | non_idempotent | off ...;
proxy_next_upstream_timeout time;
proxy_next_upstream_tries number;
proxy_no_cache string ...;

proxy_pass URL;
roxy_pass_header field;
proxy_pass_request_body on | off;
proxy_pass_request_headers on | off;
proxy_read_timeout time;
proxy_redirect default;
proxy_redirect off;
proxy_redirect redirect replacement;
proxy_request_buffering on | off;
proxy_send_lowat size;
proxy_send_timeout time;
proxy_set_body value;
proxy_set_header field value;
proxy_socket_keepalive on | off;
proxy_ssl_certificate file;
proxy_ssl_certificate_key file;
proxy_ssl_ciphers ciphers;
proxy_ssl_conf_command command;
proxy_ssl_crl file;
proxy_ssl_name name;
proxy_ssl_password_file file;
proxy_ssl_protocols [SSLv2] [SSLv3] [TLSv1] [TLSv1.1] [TLSv1.2] [TLSv1.3];
proxy_ssl_server_name on | off;
proxy_ssl_session_reuse on | off;
proxy_ssl_trusted_certificate file;
proxy_ssl_verify on | off;
proxy_ssl_verify_depth number;
proxy_store on | off | string;
proxy_store_access users:permissions ...;
proxy_temp_file_write_size size;
proxy_temp_path path [level1 [level2 [level3]]];

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 前言 nginx服務(wù)也支持代理服務(wù),其代理功能的實(shí)現(xiàn)是通過ngx_http_proxy_module此模塊來實(shí)現(xiàn)的...
    小尛酒窩閱讀 3,124評(píng)論 0 1
  • 以下內(nèi)容來自官方文檔 http://nginx.org/en/docs/http/ngx_http_upstrea...
    再回到從前閱讀 2,790評(píng)論 0 1
  • 1、搭建時(shí)間服務(wù)器,日志服務(wù)器并簡述sudo安全切換 1)安裝ntp服務(wù)器 yum install ntp 配置文...
    xinxin2019閱讀 375評(píng)論 0 0
  • I/O模型Nginx介紹Nginx的安裝和目錄結(jié)構(gòu)Nginx的配置Nginx的編譯安裝 一、I/O模型 (一)I/...
    哈嘍別樣閱讀 967評(píng)論 0 4
  • Nginx 高性能的HTTP服務(wù)器程序,又是HTTP/IMAP/POP3協(xié)議的反向代理服務(wù)器 面對(duì)較高并發(fā)請(qǐng)求時(shí),...
    SRE1閱讀 6,799評(píng)論 2 5

友情鏈接更多精彩內(nèi)容