[关闭]
@Tyhj 2018-12-02T07:52:28.000000Z 字数 492 阅读 930

ContOS搭建Nginx文件服务器

linux


  1. sudo yum install nginx
  2. sudo systemctl start nginx.service
  3. sudo systemctl enable nginx.service
  4. firewall-cmd --zone=public --add-port=80/tcp --permanent
  5. firewall-cmd --reload
  6. vim /etc/nginx/conf.d/file_server.conf
  7. vim /etc/nginx/nginx.conf
  1. server {
  2. listen 80;
  3. server_name lc-fgtnb2h8.yorhp.com; # 自己PC的ip或者服务器的域名 charset utf-8; # 避免中文乱码
  4. root /home/fileManager/; # 存放文件的目录
  5. location / {
  6. autoindex off; # 索引
  7. autoindex_exact_size on; # 显示文件大小
  8. autoindex_localtime on;
  9. }
  10. error_page 404 403 500 502 503 504 = https://github.com/404.html;
  11. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注