Welcome! Log In Create A New Profile

Advanced

Regexp в location

Михаил Монашёв
November 07, 2009 12:22PM
Здравствуйте.

Почему-то запрос попадает в другой локейшн:

2009/11/07 19:59:55 [debug] 87875#0: *4082 http request line: "GET /yandex.ru HTTP/1.1"
2009/11/07 19:59:55 [debug] 87875#0: *4082 http uri: "/yandex.ru"
2009/11/07 19:59:55 [debug] 87875#0: *4082 http args: ""
2009/11/07 19:59:55 [debug] 87875#0: *4082 http exten: "ru"
2009/11/07 19:59:55 [debug] 87875#0: *4082 http process request header line
2009/11/07 19:59:55 [debug] 87875#0: *4082 http header: "Host: хххх.ru"
2009/11/07 19:59:55 [debug] 87875#0: *4082 http header: "Accept: */*"
2009/11/07 19:59:55 [debug] 87875#0: *4082 http header: "Pragma: no-cache"
2009/11/07 19:59:55 [debug] 87875#0: *4082 http header: "User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)"
2009/11/07 19:59:55 [debug] 87875#0: *4082 http header done
2009/11/07 19:59:55 [debug] 87875#0: *4082 generic phase: 0
2009/11/07 19:59:55 [debug] 87875#0: *4082 add cleanup: 0000000800D3A990
2009/11/07 19:59:55 [debug] 87875#0: *4082 generic phase: 1
2009/11/07 19:59:55 [debug] 87875#0: *4082 test location: "/"
2009/11/07 19:59:55 [debug] 87875#0: *4082 test location: ~ "^/(\w\.\w)$"
2009/11/07 19:59:55 [debug] 87875#0: *4082 using configuration "/"


должен попадать в ^/(\w\.\w)$ , а попадает в / .

location / {
return 204;
}

location ~ ^/(\w\.\w)$ {
proxy_pass http://$1:80/favicon.ico;
}

Смысл - проксирование фавиконок разных сайтов.



--

С уважением,
Михаил Монашёв, SoftSearch.ru
mailto:postmaster@softsearch.ru
ICQ# 166233339
http://michael.mindmix.ru/
Без бэкапа по жизни.
Subject Author Posted

Regexp в location

Михаил Монашёв November 07, 2009 12:22PM

Re: Regexp в location

Igor Sysoev November 07, 2009 12:46PM

Re: Regexp в location

Михаил Монашёв November 07, 2009 12:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 108
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready