1.动静分离概念
2.为什么要用动静分离
3.动静分离与前后分离的区别
4.动静分离的实现原理
###静态资源访问—可以基于location前缀,也可以基于location后缀
server {
listen 80;
server_name static.test.com;
#基于本地root写法
location /static/imgs {
root F:/;
index index.html index.htm;
}
#基于本地alias写法
location /static/ {
alias E:/static/imgs/;
}
#基于另外服务器的图片获取,还可以解决跨域问题
location /static/ {
proxy_pass http://www.test.com/static/imgages/index-img/;
index index.html index.htm;
}
}
###动态资源访问
server {
listen 80;
server_name www.test.com;
location / {
proxy_pass http://127.0.0.1:8080;
index index.html index.htm;
}
}
5.纯后台代码如何实现静态化
【尚学堂】Java300集零基础适合初学者视频教程_Java300集零基础教程_Java初学入门视频基础巩固教程_Java语言入门到精通_哔哩哔哩_bilibili