How to install nginx 1.18 with passenger 6 on AWS ubuntu 18.04
Solution 1:
I wouldn't use Passenger. Most of us learned long ago that it was a bad idea to embed web apps into the web server, but in the early days of the web we had no other choice. Now we do, since the mid to late 2000s. There are much better ways to deploy apps, and you should consider changing your approach before continuing with passenger.
With the warning out of the way:
The problem here is that the passenger packages you are trying to use were built for the nginx packages shipped with Ubuntu. The upstream packages provided by nginx.org themselves are built quite differently and are not drop-in replacements. (I blame Debian for this, but that's also another discussion for elsewhere...)
If you really want to use passenger with nginx 1.18 on Ubuntu, use 20.04 LTS which includes nginx 1.18, use the nginx packages that come with Ubuntu, and use focal
instead of bionic
to get passenger packages.