- 安装 nginx,
sudo apt-get install nginx
- 创建 file server 配置文件
/etc/nginx/conf.d/file_server.conf
,在这里配置:- 监听的端口号
- 服务器名称,可以是 IP
- 文件服务器的根目录
- 重启 nginx 服务,
sudo service nginx restart
/etc/nginx/conf.d/file_server.conf,
1 | server { |
Keep it simple, stupid
sudo apt-get install nginx
/etc/nginx/conf.d/file_server.conf
,在这里配置:sudo service nginx restart
/etc/nginx/conf.d/file_server.conf,
1 | server { |