nginx sometimes gets killed after reloading it using systemd

You've run into a bug in perl 5.30, the version used in Ubuntu 20.04 LTS. The bug has been fixed upstream but that fix has not yet been backported to Ubuntu.

If you haven't got a need to run Perl code inside nginx (as most people do not) then you can uninstall the package libnginx-mod-http-perl and restart nginx to avoid the problem. This package was pulled in by the virtual package nginx-extras but most people don't actually run perl in the web server and so don't need it.

ubuntu@vmtest-ubuntu2004:~$ sudo apt purge libnginx-mod-http-perl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libhiredis0.14 libluajit-5.1-2 libluajit-5.1-common
  libnginx-mod-http-auth-pam libnginx-mod-http-cache-purge
  libnginx-mod-http-dav-ext libnginx-mod-http-echo
  libnginx-mod-http-fancyindex libnginx-mod-http-geoip
  libnginx-mod-http-geoip2 libnginx-mod-http-headers-more-filter
  libnginx-mod-http-lua libnginx-mod-http-ndk libnginx-mod-http-subs-filter
  libnginx-mod-http-uploadprogress libnginx-mod-http-upstream-fair
  libnginx-mod-nchan
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  nginx-core
Suggested packages:
  nginx-doc
The following packages will be REMOVED:
  libnginx-mod-http-perl* nginx-extras*
The following NEW packages will be installed:
  nginx-core
0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
Need to get 425 kB of archives.
After this operation, 173 kB disk space will be freed.
Do you want to continue? [Y/n]

ubuntu@vmtest-ubuntu2004:~$ sudo systemctl restart nginx

Though in this specific case, nginx has probably gone zombie and you will have to restart the computer.

As shown above, removing it will replace nginx-extras with nginx-core, and mark all the extras packages as eligible for autoremoval, so if you actually need any of those packages you should mark them as installed before autoremoving.

ubuntu@vmtest-ubuntu2004:~$ sudo apt-mark install libnginx-mod-http-geoip2
Selected libnginx-mod-http-geoip2 for installation.

You can also follow the issue on Launchpad.