Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何重写 nginx 基本文件名?
http://pic.test.com/view.php?filename=947284035_234601603334998.jpg
至
http://pic.test.com/947284035_234601603334998
基本文件名
以下应该做到这一点:
location /view.php { if ( $arg_filename ~ (.*)\.jpg ) {set $basename $1;} rewrite ^ $scheme://$host/$basename last; }