nginx rewriting problem
漂亮男人
漂亮男人 2017-05-16 17:24:06
0
1
434

Questions about NG rewriting

server {

    if (!-e $request_finame) {
        rewrite ^/(.*)  /index.php? last;
    }
    # or
    location / {
        if (!-e $request_finame) {
            rewrite ^/(.*)  /index.php? last;
        }
    }
}

Actually, I want to ask, the two rewriting rules are the same.
But it is written in location / and directly under the server. What's the difference.

If it is written outside, www.example.com/packages/xxx.apk cannot be downloaded.
If it is inside, www.example.com/packages/xxx.apk, as long as the path exists, it can be downloaded.

I didn't know the reason. Please kind-hearted people can clarify this. Thanks

漂亮男人
漂亮男人

reply all(1)
曾经蜡笔没有小新


Saw it in an article.
Nginx Rewrite Research Notes

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!