This topic created in 2851 days ago, the information mentioned may be changed or developed.
因为磁盘空间满了,无法直接扩容,所以加了一块磁盘,
现在打算用 nginx 判断文件是否存在,否则查找另一个路径,
请问使用 nginx 能解决吗,配置文件要怎么配置?
www.aaa. com/data1/upload/2018/08/07/1.jpg
www.aaa. com/data2/upload/2018/08/07/1.jpg
8 replies • 2018-08-07 15:55:26 +08:00
 |
|
3
wizardoz Aug 7, 2018
直接 google nginx 404 redirect to ur
|
 |
|
4
RobertYang Aug 7, 2018 via Android
if (!-e $request_filename) { rewrite }
|
 |
|
5
rrfeng Aug 7, 2018
try_files 了解一下
|
 |
|
6
est Aug 7, 2018
|
 |
|
7
zmc Aug 7, 2018
location /upload/ { root /data1/project; try_files $uri $uri/ /index.html; } 谢谢大家解答,存在第一个$uri 能匹配上,/data1/project/2018/08/07/1.jpg 如果不存在,那么第二个$uri 要怎么写,/data2/project/2018/08/07/1.jpg
|
 |
|
8
jswh Aug 7, 2018 1
在 data1/project 下软连接 project2 -> /data2/project 然后 location /upload/ { root /data1/project; try_files $uri $uri/ project2/$uri project2/$uri2/ /index.html; }
可能可以
|