前言
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,可以自行修改

需要外網訪問需要關閉防火牆開放本地端口,具體請百度。

