nginx学习随笔--proxy_temp_path

本文介绍Nginx中proxy_temp_path指令的使用方法,该指令用于定义存储从代理服务器接收数据的临时文件目录,并支持最多三层子目录结构。

nginx学习随笔–proxy_temp_path

英文原文:

Syntax: proxy_temp_path path [level1 [level2 [level3]]];
Default:    proxy_temp_path proxy_temp;
Context:    http, server, location

Defines a directory for storing temporary files with data received from proxied servers. Up to three-level subdirectory hierarchy can be used underneath the specified directory. For example, in the following configuration:

proxy_temp_path /spool/nginx/proxy_temp 1 2;

a temporary file might look like this:

/spool/nginx/proxy_temp/7/45/00000123457

中文翻译:
为存储承载从代理服务器接收到的数据的临时文件定义目录。指定目录下支持3级子目录结构:

proxy_temp_path /spool/nginx/proxy_temp 1 2;

临时文件路径可能像这样:

/spool/nginx/proxy_temp/7/45/00000123457

这里的level1,2,3如果有值就代表存在一级,二级,三级子目录。

目录名是由数字进行命名的,所以这里的具体的值就是代表目录名的数字位数。

root@17e9526c08b8:/# nginx -V 2>&1 | grep njs root@17e9526c08b8:/# nginx -V 2>&1 | grep njs root@17e9526c08b8:/# nginx -V nginx version: nginx/1.21.1 built by gcc 8.3.0 (Debian 8.3.0-6) built with OpenSSL 1.1.1d 10 Sep 2019 TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fdebug-prefix-map=/data/builder/debuild/nginx-1.21.1/debian/debuild-base/nginx-1.21.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' root@17e9526c08b8:/# nginx -V 2>&1 | grep NJS root@17e9526c08b8:/# nginx -V 2>&1 | grep NJS
最新发布
09-03
可以通过 `nginx -V` 命令的输出判断 Nginx 是否启用了 njs 模块。执行该命令后,查看输出内容中是否包含 `--add-module=path/to/ngx_http_js_module` 或类似的与 njs 模块相关的编译参数信息。如果有,则表明 Nginx 在编译时启用了 njs 模块。 例如,可能会看到类似如下的输出: ```plaintext nginx version: nginx/1.23.4 built by gcc 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1) built with OpenSSL 1.1.1f 31 Mar 2020 TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-1.23.4=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' --add-module=/build/nginx-1.23.4/debian/modules/nginx-http-geoip2 --add-module=/build/nginx-1.23.4/debian/modules/nginx-http-image-filter --add-module=/build/nginx-1.23.4/debian/modules/nginx-http-xslt-filter --add-module=/build/nginx-1.23.4/debian/modules/nginx-mail-proxy --add-module=/build/nginx-1.23.4/debian/modules/nginx-stream-geoip2 --add-module=/build/nginx-1.23.4/debian/modules/nginx-http-njs ``` 在上述输出中,`--add-module=/build/nginx-1.23.4/debian/modules/nginx-http-njs` 表明 Nginx 启用了 njs 模块。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值