Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy an angularjs application frontend with Nginx and dropwizard

I'm developing an application using angularjs application frontend having as backend dropwizard. I'm planning to use Nginx as gateway for the backend dropwizard server and as an asset server (images and maybe the angularjs application).

My question is what is the best strategy for deployement:

  1. Bundling angularjs with the dropwizard backend and using nginx as frontend?
  2. Deploying angularjs application on the nginx server?

Thanks in advance,

like image 599
Master Mind Avatar asked May 18 '15 15:05

Master Mind


1 Answers

I would use the nginx as a API Gateway which route your requests to your backend.

Implement an API gateway that is the single entry point for all clients. The API gateway handles requests in one of two ways. Some requests are simply proxied/routed to the appropriate service. It handles other requests by fanning out to multiple services.

With a Gateway you have the flexibility to change your backend as you like. Because the nginx works only as a gateway he can also serve your static files (angularjs). A gateway has more advantage like logging, authentication etc.

like image 169
fabwu Avatar answered Sep 20 '22 18:09

fabwu