In general you'll probably want to get nginx's assistance for this or if that's not possible and it's really important change the source code as Leo suggests.
There is one cringe-inducing, wtf-provoking trick which I am mentioning as a curiosity. You can set the append-only mode on the directory. If your filesystem supports it you can say:
chattr +a mydir
Your process will be able to create stuff inside but not remove it. Then at your leisure you can use inotify_wait
to monitor the directory for changes. I don't know of any clean ways to remove the files though.