28 lines
697 B
Plaintext
28 lines
697 B
Plaintext
|
#!/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
|
||
|
|
||
|
[ -n "${NGX_HTTP_MAX_RANGES:-}" ] || NGX_HTTP_MAX_RANGES=${_NGX_HTTP_MAX_RANGES}
|
||
|
case "${NGX_HTTP_MAX_RANGES}" in
|
||
|
"${_NGX_HTTP_MAX_RANGES}" ) ;;
|
||
|
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] ) ;;
|
||
|
0 )
|
||
|
log "HTTP: Range/If-Range/Accept-Ranges support is disabled"
|
||
|
;;
|
||
|
* )
|
||
|
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
|
||
|
|
||
|
unset _NGX_HTTP_MAX_RANGES
|
||
|
fi
|