Welcome! Log In Create A New Profile

Advanced

Re: Confused by documentation for /alias/

August 10, 2011 06:43AM
I understand the regexp. $1 = book.pdf

So for the specific request in the example, we could write:

location ~ ^/download/(.*)$ {
alias /home/website/files/book.pdf;
}

Is it that the example is unrealistic? Because this config does exactly the same thing:
location /download/ {
alias /home/website/files/;
}

I'm struggling to see the difference, and why one would use the regexp.

How about requesting "/download/baz/foo/book.pdf" for the above regexp config and this one:
location ~ ^/download/(.*)/foo/ {
alias /home/website/files/$1;
}

(why would I do this?)
Subject Author Posted

Confused by documentation for /alias/

graq August 10, 2011 06:15AM

Re: Confused by documentation for /alias/

Boyko Yordanov August 10, 2011 06:20AM

Re: Confused by documentation for /alias/

graq August 10, 2011 06:43AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 57
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready