@Tyhj
2018-12-02T15:52:28.000000Z
字数 492
阅读 953
linux
sudo yum install nginx
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
vim /etc/nginx/conf.d/file_server.conf
vim /etc/nginx/nginx.conf
server {
listen 80;
server_name lc-fgtnb2h8.yorhp.com; # 自己PC的ip或者服务器的域名 charset utf-8; # 避免中文乱码
root /home/fileManager/; # 存放文件的目录
location / {
autoindex off; # 索引
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on;
}
error_page 404 403 500 502 503 504 = https://github.com/404.html;
}