Home > Backend Development > PHP Tutorial > nginx - apk包HTTP请求强制经由PHP处理

nginx - apk包HTTP请求强制经由PHP处理

WBOY
Release: 2016-06-06 20:15:15
Original
1772 people have browsed it

想将http请求,类似 http://example.com/xxxx.apk 在浏览器访问时加一些行为处理而非直接download

自己的思路是在nginx上做相应的跳转配置,但没起到作用

<code>location / {
  rewrite ^/(.apk)$ /index.php/$1 last;
}
</code>
Copy after login
Copy after login

请教下其他思路或者处理方式

回复内容:

想将http请求,类似 http://example.com/xxxx.apk 在浏览器访问时加一些行为处理而非直接download

自己的思路是在nginx上做相应的跳转配置,但没起到作用

<code>location / {
  rewrite ^/(.apk)$ /index.php/$1 last;
}
</code>
Copy after login
Copy after login

请教下其他思路或者处理方式

可以了,补充个答案,rewrite错位置了

<code>location ~ \.apk{
        rewrite ^/(.*)\.apk$ /index.php/$1 last;
}</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template