Server mp4 file larger than 2GB on 32bit system

Maxim Dounin mdounin at
Sun Jun 6 16:10:38 UTC 2021


On Sat, Jun 05, 2021 at 08:35:32AM +0000, 王 静凯 wrote:

> I compile a nginx for an 32bit system (ARM).
> When I request a mp4 file which is larger than 2GB then it response with '416 Requested Range Not Satisfiable’.
> The type of max_ranges is ngx_uint_t, I could not set it max than about 2000000000.
> In this situation, I could I server the mp4 file correctly?

The max_ranges directive is to limit the number of ranges in a 
request, which almost always at most one (and just one in the 
request you've showed).  And it is completely unrelated to 416 
errors.  Just leave the default. 

> The ngx_size is set to 4 when I compile nginx.
> So:
> #define NGX_MAX_SIZE_T_VALUE  2147483647
> #endif
> #ifndef NGX_SIZE_T_LEN
> #define NGX_SIZE_T_LEN  (sizeof("-2147483648") - 1)
> #endif
> #define NGX_MAX_OFF_T_VALUE  2147483647
> #endif
> #ifndef NGX_OFF_T_LEN
> #define NGX_OFF_T_LEN  (sizeof("-2147483648") - 1)
> #endif

What does "./configure" output show?  Are you running configure on 
the target system, or tried to cross-compile nginx?

It looks like for some reason nginx wasn't able to find out how to 
instruct your system to use 64-bit off_t.  The most likely reason 
I can think of is an attempt to cross-compile nginx.  Note that 
cross-compiling is not supported and not going to work.  The most 
simple and the only supported solution would be to compile nginx 

Maxim Dounin

More information about the nginx mailing list