关于NGINX的X-Accel-Redirect response,该如何解决

WBOY
Release: 2016-06-13 12:32:03
Original
1072 people have browsed it

关于NGINX的X-Accel-Redirect response
在网上看了数篇文章,都是说可以用来控制文件下载的权限。
其原理都是说访问download.php时验证权限,如果通过则header("X-Accel-Redirect: 目标文件")。

不过我有个疑问,要是我知道目标文件的真实文件名和存放路径之后直接访问,那不是绕过了X-Accel-Redirect了?

举个例子:
假设目标文件实际存放在 http://www.1.com/download/123.xls
而在网站页面上有下载链接 http://www.1.com/download.php?file=xxxx
那么通过该链接可以实现权限控制,但是如果我直接输入http://www.1.com/download/123.xls进行访问呢?不是绕过了权限控制了吗?

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!