Opened 4 months ago
Last modified 3 months ago
#2674 new defect
Unable to set `proxy_max_temp_file_size` greater than 1024m
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | major | Milestone: | |
Component: | nginx-module | Version: | 1.25.x |
Keywords: | proxy_max_temp_file_size, Windows | Cc: | PyroGenesis@… |
uname -a: | Windows Server 2022 21H2 | ||
nginx -V: |
nginx version: nginx/1.27.0
built by cl 16.00.30319.01 for 80x86 built with OpenSSL 3.0.13 30 Jan 2024 TLS SNI support enabled configure arguments: --with-cc=cl --builddir=objs.msvc8 --with-debug --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msvc8/lib/pcre2-10.39 --with-zlib=objs.msvc8/lib/zlib-1.3.1 --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-mail --with-stream --with-stream_realip_module --with-stream_ssl_preread_module --with-openssl=objs.msvc8/lib/openssl-3.0.13 --with-openssl-opt='no-asm no-tests -D_WIN32_WINNT=0x0501' --with-http_ssl_module --with-mail_ssl_module --with-stream_ssl_module |
Description
I am using NGINX on Windows as a reverse proxy to a library endpoint. I want to increase the value in the proxy_max_temp_file_size
directive to serve some of my larger libraries.
However, setting proxy_max_temp_file_size
to a value above 1024m gives me the following error:
`
nginx: [emerg] "proxy_max_temp_file_size" directive invalid value in path/to/nginx.conf:178
`
Here is the full nginx.conf
`nginx
#user nobody;
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# upstream endpoint
upstream pypi-gpu {
server localhost:9500;
}
server {
listen 9000 ssl;
server_name pythonlibs.mydomain.com;
ssl_certificate "path/to/cert.crt";
ssl_certificate_key "path/to/private.key";
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_max_temp_file_size 3072m;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://pypi-gpu;
}
}
}
`
Note that setting proxy_max_temp_file_size 0
allows me to serve large files but I'd prefer to keep this bounded if possible.
nginx version: nginx/1.27.0
On win32 max value of size_t allowed by nginx is 2G, which is 2048M. Everything greater than that will be rejected. This can potentially be fixed in the future by switching to off_t instead.