Nginx Introduction
Starting from scratch can often seem dull and uninspiring.
So, let’s first define a scenario, and from there, all the learning will be aimed at completing this scenario.
Scenario Description
We have set up an API for a model inference service on the server. It allows us to send data via HTTP to the server and receive a response.
The current scenario is: We need to expose this API endpoint to the outside world.
For example, our API endpoint is https://temp_api.example.com/test
, and we expect to be able to retrieve the response using curl
, like this:
API_URL="https://temp_api.example.com/test"
curl -X GET $API_URL
The response might be a string:
{
"message": "API is running!"
}
The above API endpoint is hypothetical and does not actually exist.
Prerequisites
In this scenario, we will use Let's Encrypt to obtain an SSL certificate to provide HTTPS service.
Since Let's Encrypt requires domain name resolution and does not accept IP addresses, please make sure you have a domain name available if you want to follow along.
Learning Goals
We expect to learn the following:
- ✅ Nginx Introduction
- ✅ Nginx Reverse Proxy
- ✅ Nginx HTTPS Configuration
- ✅ Nginx Security
- ✅ Nginx Monitoring
- ✅ Nginx Serving Static Resources
- Set Up Nginx Load Balancing