Can't set up alias and rewrite in location
January 07, 2014 10:38PM
I have a root directory defined in main config file in http {...}. The problem part of config is following:

server {
listen 80;

server_name localhost.dev;

location /89262207055 {
root /89262207055/;

location /file {
alias index.php?id=file&name=;
}

rewrite ^(.*).html$ index.php?id=block&block=$1;
}
}

When I start nginx it tells that location "/file" is outside location "/89262207055". I don't have any ideas, why is it. Found lots of exmaples on the net and my config seems to be correce, but it isn't.
And also the rewrite here doesn't work at all. There're entries in log, that show it.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 335
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready