
Ssl_certificate_key /etc/ ssl /certs/nginx/site1. Ssl_certificate /etc/ ssl /certs/nginx/site1. But for the sake of the tutorial, let's create two web services with a simple index.html page. We need to set up two containers for web services or two applications that could be written in any language. We will set up Nginx container that will be bind to port 80 to the docker host's port 80 and it will forward the request to web application running on multiple containers. We can use a reverse proxy to access multiple web applications running on multiple containers through single port 80. Inside the docker container, it is not possible to access ports and IP addresses that are private unless they are bound to host. Let's establish a use case for setting up NGINX reverse proxy using docker. Enterprises don't have to spend money on purchasing multiple OS to deploy individual applications.

So a developer can create many containers and run several applications on one host operating system. Docker sits on an existing host operating system and allows a developer to make light-weight containers on virtual machines to run their applications. Containers allow a developer to package up an application with necessary modules, libraries, dependencies and deploy it as one of the packages. Reverse proxy lets you make secure internal requests.ĭocker is a popular enterprise PAAS (Platform as a Service) to create, run, and deploy applications by using containers. Reverse proxies are usually implemented to increase security, performance, and reliability. A reverse proxy sits in front of the web servers and forwards client requests to the servers. If the client or user wants to see the API, then the client creates this request: /api, but behind the scene, reverse proxy converts it to :3000. But behind the scene reverse proxy converts this request to :8080. The client wants to see the app so the client creates this request:. The client makes an HTTP request to talk to your application. In this example, the postman is a reverse proxy, the source is client, and you are applying. Postman retrieved letters on behalf of you from multiple sources. Note: Senders didn't have to make direct contact with you. All those letters are sent from different places, but they all end up to you at the right place. Postman gives you multiple letters, invoices, postcards, and other forms of letters.

Let's say you woke up in the morning and you see postman on your door. Disclaimer: Don't judge me, I am a tech-savvy person. It would not be fair if I don't throw in an analogy here. Proxy is all about making secure external requests. All the internet requests are made under one IP address which makes it harder to trace back to an individual computer. All computers inside a company have IP address under the supreme IP address of a company. Then you can make an HTTP request on the internet and that request would go to Nigeria first and then on the internet in easy language.Īnother example of proxy would be multiple computers in one company or building. You can set up a proxy server in Nigeria. A proxy provides security, privacy, and other levels of functionality. A proxy acts as a firewall between you and the internet.

In this example, the waiter is a proxy, and the chef is the internet. The chef doesn't know for whom was that food. The waiter fulfilled your request without making you go to the kitchen. Key things to note: You requested the waiter. The waiter asks the chef to cook all the things that you asked from the waiter. The waiter takes your order and goes to the kitchen. Let's say you walk into your favorite restaurant. Let me try to explain it using an analogy. Reverse proxy using docker makes it easier to accomplish. Instead of typing stupid ports, you could establish routes for multiple containers, and those routes URLs could be anything. Wouldn't be nice to just do something like this to access API: /api and for an app: /app. Now imagine remembering multiple ports for multiple applications. There could be multiple ports for one application to access different pages: home, dashboard, contacts, table, e.t.c. To access the API of an app, you would type :3000 and for the application, you would type something like this :4040. Imagine a time when you set up the local server and created a front-end application based on it.
