1 安装 yum install nginx  :   配置文件目录  /etc/nginx/nginx.conf

 检测配置 :nginx -tc /etc/nginx/nginx.conf  
 重启  nginx -s reload -c /etc/nginx/nginx.conf
 
3 静态资源配置,在/usr/local/static/image/ 中我们放一张图片1.jpg上去,重启nginx服务  ,访问路径 localhost:80/image/1.jpg
  location /image/ {
    root /usr/local/static/;
    autoindex on;
   }
 
posted on 2018-08-15 16:55  撿忔  阅读(72)  评论(0编辑  收藏  举报