1.实现效果

【nginx】基于ngnix的动静分离_html

2.准备工作

   在linux服务器/创建一个websitedata/image/qxlxi.jpg  和 websitedata/html/a.html 资源、

3.修改Nginx配置文件

server{
listen 80;
server_name 192.168.58.136;

location /html/{
root /websitedata/;
index index.html index.htm;
}

location /images/{
root /websitedata/;
autoindex on;
}
}

【nginx】基于ngnix的动静分离_html_02

【nginx】基于ngnix的动静分离_linux服务器_03