C.C.
C.C.

Reputation: 1070

Can I add passenger support to a existed Nginx instead of rebuild one?

I have a server running with nginx serving two php websites, right now I want to make it serving a rails app, I've googled, but there no notes about add passenger support to a existed nginx, all of them are telling me run passenger-install-nginx-module to build a nginx.

Can I add passenger support to my nginx instead of rebuild it?

Thanks for any helps.

Upvotes: 3

Views: 2764

Answers (2)

Jong Bor Lee
Jong Bor Lee

Reputation: 3855

There is no need to rebuild nginx if you use Phusion Passenger Standalone.

From Passenger's wiki:

"But I don't want to recompile Nginx. Are there alternatives?"

Yes. Use Phusion Passenger's Standalone mode. Phusion Passenger Standalone is a standalone server. It does not extend Nginx so it does not need to recompile Nginx. It will therefore work perfectly with your existing Nginx installation.

When using Passenger Standalone, you are supposed to:

Start Passenger Standalone on a certain port or socket file.
Add reverse proxy rules to your Nginx configuration file, to forward requests to Passenger Standalone.

If you've ever used Unicorn and Puma, then using Passenger Standalone will be very familiar: usage is almost the same.

Upvotes: 0

Pavel Chuchuva
Pavel Chuchuva

Reputation: 22465

You still need to rebuild nginx. If you run passenger-install-nginx-module you will see this output:

Nginx doesn't support loadable modules such as some other web servers do, so in order to install Nginx with Passenger support, it must be recompiled.

See Installing Passenger as a normal Nginx module for steps.

cd /path-to-nginx-source-dir
./configure --prefix=/opt/nginx \
  --add-module=$(passenger-config --nginx-addon-dir) \
  --add-module=/path-to-some-nginx-module
make
sudo make install

The value for /path-to-passenger-module can be obtained with the command:

passenger-config --nginx-addon-dir

Upvotes: 2

Related Questions