Is there a way to install the latest stable NGinx on Ubuntu Focal (20.04) with nginx-extra modules using binaries?

There is a PPA. Another option would be to run it in a container.

But you are wrong with this statement:

which has some security vunlerabilities

Major Linux distributions port security fixes to the versions they provide. As long as the version you are using is supported (until 2025 in the case of Ubuntu 20.04) you can be sure that all security vulnerabilities are patched.

If this is your only concern you don’t need to do anything more that install regular security updates.

Read more here: Source link