2 steps to build nginx file server in Linux

effect

Insert picture description here

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

Insert picture description here

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/;
Insert picture description here
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:
Insert picture description here

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.

Guess you like

Origin blog.csdn.net/u010312671/article/details/107098637