This topic created in 3018 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
 |
|
理论上来说属于重定向的一种 nginx 就不是很懂了
|
 |
|
直接 google nginx 404 redirect to ur
|
 |
|
if (!-e $request_filename) { rewrite }
|
 |
|
try_files 了解一下
|
 |
|
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
|
 |
|
在 data1/project 下软连接 project2 -> /data2/project 然后 location /upload/ { root /data1/project; try_files $uri $uri/ project2/$uri project2/$uri2/ /index.html; }
可能可以
|