Страница 1 из 1

nginx secure_link выдает 404 not found

Добавлено: 15 июн 2017, 18:34
koji
В файле Apache-2.4+Nginx-1.7_vhostn.conf прописал:
location /get/ {
	rewrite /get/([a-zA-Z0-9_\-]*)/([0-9]*)/(.*)$ /files/$3?hash=$1&time=$2;
}

location /files/ {
secure_link $arg_hash,$arg_time;
secure_link_md5 "$secure_link_expires$uri$remote_addr secret";
	if ($secure_link = "") {
		return 403;
	}

	if ($secure_link = "0") {
		return 410;
	}
}
Прямая ссылка выглядит так: http://srv1.domain.com/files/video.mp4
В логах:
2017/06/15 16:51:06 [error] 21164#21332: *3 CreateFile() "c:\openserver\modules\http\Apache-2.4+Nginx-1.7/html/files/video.mp4" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: srv1.domain.com, request: "GET /get/3AVXQeulzjAETZqtlJet-Q/1497534684/video.mp4 HTTP/1.1", host: "srv1.domain.com", referrer: "http://domain.com/test"
Подскажите, в чем проблема?

Re: nginx secure_link выдает 404 not found

Добавлено: 15 июн 2017, 19:08
Максим
Добавьте
  if ($secure_link = "1") {
            rewrite ^ /путь$uri;
        }
или укажите root каталог для этого location.