如何修改网站模版,阿里云建设网站买哪个服务,做360全景的网站,济南正规做网站公司1. 对根目录下的静态资源代理
Nginx代理nginx.conf配置——反向代理
2. 目录代理
如果需要将资源代理到不同的目录下#xff0c;则在nginx.conf中的server节点下进行如下配置#xff1a;
location /image {root /opt/cache;
}location vedio {root /opt/cache;
}
修改后…1. 对根目录下的静态资源代理
Nginx代理nginx.conf配置——反向代理
2. 目录代理
如果需要将资源代理到不同的目录下则在nginx.conf中的server节点下进行如下配置
location /image {root /opt/cache;
}location vedio {root /opt/cache;
}
修改后重新加载nginx配置即可nginx部分命令如下
# 检查配置
nginx -t
# 重载配置
nginx -s reload
# 关闭
nginx -s quit
# 启动
nginx -s start
3. 代理指定路径下的静态资源
在server中添加如下配置示例listen端口为80
location ~ /video/.*\.(mp4)?$ {expires -1;# 匹配结果示例opt/cache/video/demo.mp4root /opt/cache;
}
访问localhost/video/demo.mp4即可访问