---
# System prepended metadata

title: Nginx

---

# Nginx

0. Web interface of API before adding secure connection
 ![](https://i.imgur.com/wh4DS8t.jpg)


1. Generate the certificates

![](https://i.imgur.com/XGXG2VE.png)


2. Update nginx configuration
![](https://i.imgur.com/wxCgNEb.png)


3. Update `Dockerfile`
![](https://i.imgur.com/T7y2vmq.png)


4. Build the container & push to DockerHub
![](https://i.imgur.com/Z7UpEmp.png)


5. Run the backend part & check connection
```
$ docker-compose up
```
![](https://i.imgur.com/5gpuPxb.png)


6. Certificate
![](https://i.imgur.com/cESTeFP.png)
![](https://i.imgur.com/ND0PIk5.png)


7. Update nginx conf
![](https://i.imgur.com/NusG3i4.png)


8. Build & push new nginx container
![](https://i.imgur.com/DYwsSMf.png)


9. Update `docker-compose.yml`
![](https://i.imgur.com/UjPYM26.png)
*removing explicit mapping of ports for `django_gunicorn` & adding `scale = 3`*

10. build and run container
![](https://i.imgur.com/0KtXZj9.png)
![](https://i.imgur.com/p5fa3mZ.png)
