The HTTP request of the nginx-apk package is forcibly processed by PHP.

Source: Internet
Author: User
I want to add some behavior processing to the HTTP request and example.comxxxx.apk while accessing the browser, rather than directly downloading. The idea is to configure the redirection on nginx, but it does not play a role {code ...} ask for other ideas or ways to handle the http request, similar to the http://example.com/xxxx.apk in the browser access to add some behavior processing rather than direct download

The idea is to configure the redirection on nginx, but it does not work.

Location/{rewrite ^/(.apk) $/index. php/$1 last ;}

Ask for other ideas or solutions

Reply content:

To process http requests, like a http://example.com/xxxx.apk that adds behavior to browser access rather than directly download

The idea is to configure the redirection on nginx, but it does not work.

Location/{rewrite ^/(.apk) $/index. php/$1 last ;}

Ask for other ideas or solutions

Yes. I can add an answer. rewrite is at the wrong position.

Location ~ \. Apk {rewrite ^/(. *) \. apk $/index. php/$1 last ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.