Reputation: 743
I have a rest microservice and would like to setup nginx as a reverse proxy for it. I am little confused about which approach to follow:
Can someone explain which one is better
Upvotes: 3
Views: 974
Reputation: 384
Option 1 will work but it is looks to be inefficient way to do what you have mentioned. Nginx is a highly capable server (footprint/runtime resources) and can easily be able to serve multiple applications from a separate pod. So I think the option 2 is a better option.
Running nginx separately will have following advantages:
I have had a similar requirement. I used a single nginx on a separate pod to serve multiple (250) application deployments running on different pods. I used proxy_pass directive to get the job done.
Upvotes: 3
Reputation: 472
In my opinion, running nginx in a separate pod is a better option because that way you can scale up and down application separately from a proxy. Usually, we use one container with proxy and few with API.
Upvotes: 6