I have got Apache and passenger on my small notebook. I wish to test Nginx and passenger on a single machine. I'm able to install Nginx on 8080 and apache on 80. But could I install passenger with both same server on a single machine?

Yes, simply install the apache module and so the nginx module. You'll most likely have to make certain each server includes a different PassengerTempDir setting too.

I'd both Apache and Nginx with passenger installed and dealing fine on a single Arch Linux machine, serving a Rails application. Once, with apache running and listening on port 80, I began nginx listening on a single port and also got an (expected) error concerning the port being already bound. I ended apache and nginx, restarted nginx and began getting Bad Gateway errors whenever I attempted to gain access to the Rails application under Nginx. I still haven't determined exactly what the problems is and just how to repair it. Restarting does not appear to assist.