31 lines
743 B
Bash
Executable File
31 lines
743 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ "${NGX_HTTP}" = 0 ] ; then
|
|
unset NGX_HTTP_MAX_RANGES
|
|
else
|
|
unset _NGX_HTTP_MAX_RANGES
|
|
## here should be SANE defaults (!)
|
|
_NGX_HTTP_MAX_RANGES=16
|
|
|
|
if [ -z "${NGX_HTTP_MAX_RANGES:-}" ] ; then
|
|
unset NGX_HTTP_MAX_RANGES
|
|
else
|
|
case "${NGX_HTTP_MAX_RANGES}" in
|
|
## allow values within [1;999]
|
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] ) ;;
|
|
0 )
|
|
log_always "HTTP: Range/If-Range/Accept-Ranges support is disabled by NGX_HTTP_MAX_RANGES=0"
|
|
;;
|
|
* )
|
|
log_always "NGX_HTTP_MAX_RANGES: unrecognized value: ${NGX_HTTP_MAX_RANGES}"
|
|
log_always "setting NGX_HTTP_MAX_RANGES=${_NGX_HTTP_MAX_RANGES}"
|
|
NGX_HTTP_MAX_RANGES=${_NGX_HTTP_MAX_RANGES}
|
|
;;
|
|
esac
|
|
|
|
export NGX_HTTP_MAX_RANGES
|
|
fi
|
|
|
|
unset _NGX_HTTP_MAX_RANGES
|
|
fi
|