effect
Business scene
In the development of microservice projects, upload and download are essential. And there are many types of uploads, such as pictures, texts, videos, excel, word documents, etc. And it needs to be used in multiple microservices. Therefore, extract the upload and download addresses and use nginx as the image server.
The first step: install nginx in linux
In the previous article, Guagua wrote that Linux installs nginx and starts it , so I won’t repeat the installation here.
Step 2: Configure image address mapping in nginx
1. Modify nginx.conf, the steps are as follows
2. The revised content is as follows:
Image server access port: 9998 The
URL path prefix points to: /images/
points to the local Linux path: /home/ftpFile/;
After the operation is completed, press ESC to exit the modification. Then: wq can exit.
The address of the picture folder in Linux is as follows:
All right. I have mapped all the details of the configuration. On the one hand, it is convenient for everyone to read, and it is also convenient for you to check later. If you like it, please pay attention.