Nginx搭建文件共享服务器

前言

Nginx除了做正反向代理和负载均衡,还能做动静分离服务器,如此便可以当作文件共享服务器使用。

环境

WIN 10
Vmware Workstation 15 Player
CentOS Linux release 7.6.1810
Nginx 1.18.0

安装Nginx

yum install -y gcc-c++pcre pcre-develzlib zlib-developenssl openssl-devel

wget http://nginx.org/download/nginx-1.18.0.tar.gz

tar zxvf nginx-1.18.0.tar.gz

cd nginx-1.18.0

./configure --prefix=/usr/local/nginx

make&&make install

配置文件共享

cd /usr/local/nginx/conf

vim nginx.conf       

启动nginx

cd /usr/local/nginx/sbin
./nginx

检查

curl 127.0.0.1       #nginx默认端口80,可以自行修改


需要外网访问需要关闭防火墙开放本地端口,具体请百度。

posted @ 2020-09-22 13:27  Harry_666  阅读(2390)  评论(0编辑  收藏  举报