Two trivial methods to truncate a file in Linux

Typically I use:

truncate -s0 /var/log/nginx/access.log
or simply:
>/var/log/nginx/access.log