关于java:使用nginx为静态资源提供服务

10次阅读

共计 209 个字符,预计需要花费 1 分钟才能阅读完成。

1. 将我的项目或者动态资源(图片、视频、音频)放到 nginx 服务器上

2. 配置 nginx.conf

可配置多个 location
root:指定拜访门路
index:指定首页 localhost:90/imooc// (* 为 imooc 下的门路)
alias:配置别名 localhost:90/static// (* 为 imooc 下的门路)

附: 使 gzip 压缩晋升申请效率。

在 nginx.conf 文件中做如下操作

再附 localtion 匹配规定

正文完
 0