Welcome! Log In Create A New Profile

Advanced

Re: X-Accel-Redirect without internal

Maxim Dounin
July 14, 2013 02:42PM
Hello!

On Sun, Jul 14, 2013 at 08:30:38AM -0400, jordanmoreira57 wrote:

> Hello,
>
> My problem is very simple, I'd like to change from php readfile to
> x-accel-redirect. I know exactly how to do it, but I have a problem:
>
> My files are organized like that:
> /home/ID(id of directory on mysql)/ .mp3 .xml and .zip/.rar
>
> I would like to serve the .zip or .rar files by php, but .xml and .mp3 needs
> to be allowed from accessing directly. When I put /home/ID as internal,
> isn't possible access the .xml or .mp3 files.
>
> What I need to do to have the xml and mp3 files being accessed directly and
> zip/rar by x-accel-redirect ON THE SAME directory?

Try something like this:

location /directory/ {

location ~ \.(xml|mp3)$ {
# accessible
}

location ~ \.(zip|rar)$ {
internal;
}
}

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

X-Accel-Redirect without internal

jordanmoreira57 July 14, 2013 08:30AM

Re: X-Accel-Redirect without internal

Maxim Dounin July 14, 2013 02:42PM

Re: X-Accel-Redirect without internal

jordanmoreira57 July 14, 2013 04:07PM

Re: X-Accel-Redirect without internal

Jonathan Matthews July 14, 2013 06:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 254 on July 05, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready