1、添加Nginx的repository
sudo yum install epel-release
2、安装Nginx
sudo yum install nginx
3、启动Nginx
sudo systemctl start nginx或者service nginx start
4、访问
默认端口80http://8.142.76.223/

5、设置文件夹
5.1、修改config文件
cd /etc/nginxvim nginx.conf
5.2、在一个server{}中添加 一个location 部分
server {listen 8091;server_name _;location / {root /data/upload/; # 多联屏 普惠autoindex on;autoindex_exact_size off;autoindex_localtime on;}error_page 404 /404.html;location = /404.html {}error_page 500 502 503 504 /50x.html;location = /50x.html {}}
5.3、新建 /data/upload/文件夹,重启nginx
sudo systemctl enable nginx或service nginx restart
6、验证
copy 一张图片到 server 的该共享目录下,可以使用 WinSCP 工具
浏览器输入地址http://8.142.76.223:8091/,看到如下页面:

