Dr. Joao Paulo
Dr. Joao Paulo

Reputation: 491

Ruby on Rails Deploy - Is nginx necessary?

I've successfully deployed my Rails application to Digital Ocean by configuring a git post-receive hook and running my puma server through screen (screen rails server).

It seems to be working and accessible at http://178.128.12.158:3000/

Do I still need to implement nginx? My purpose is only serving my API and a CMS website at the same domain.

And about deployment packages like capistrano/mina? Why should I care about them if git hook is serving me well?

Thank you in advance

Upvotes: 2

Views: 757

Answers (2)

stmpjmpr
stmpjmpr

Reputation: 131

If you want static resources to be served by a web server, which is often faster, you'll want to front-end your rails app with something like nginx. Nginx will offer a lot more flexibility for tuning how you serve your app.

Capistrano is for deployments, and again, is more flexible than the basic hook approach. For instance, if you intend to have different hosts (for db, web, assets, etc.), or multiples of them, then Cap is your friend.

Upvotes: 1

Gokul P
Gokul P

Reputation: 464

If you're going to manage large number of traffic with load balancing mode nginx will help. We can add some constraint like block some sent of IP access, etc...

For more refer the following link: https://www.nginx.com/resources/glossary/application-server-vs-web-server/

Upvotes: 2

Related Questions