Welcome! Log In Create A New Profile

Advanced

Re: Организация локейшенов

Denis F. Latypoff
May 28, 2012 11:04AM
28.05.2012, 21:58, "c350" <nginx-forum@nginx.us>:
> Здравствуйте.
>
> Как более грамотно написать?
>
> Вариант 1):
> set $backend 'http://127.0.0.10:80';
> location ~* /location1 {
>         rewrite ^ /backend_scripts/path/to/script1 break;
>         proxy_pass $backend$uri$is_args$args;
> }
> ...
> location ~* /locationN {
>         rewrite ^ /backend_scripts/path/to/scriptN break;
>         proxy_pass $backend$uri$is_args$args;
> }
>
> Вариант 2):
> set $backend 'http://127.0.0.10:80';
> location ^~ /backend_scripts/ {
>         proxy_pass $backend$uri$is_args$args;
> }
> location ~* /location1 {
>         rewrite ^ /backend_scripts/path/to/script1 last;
> }
> ...
> location ~* /locationN {
>         rewrite ^ /backend_scripts/path/to/scriptN last;
> }
>
> Подозреваю, что более правильный
> вариант1, но хотелось бы услышать
> мнение знающих людей.
>

location ~* /location\d+ {
rewrite /location(\d+) /backend_scripts/path/to/script$1 break;
proxy_pass http://127.0.0.10;
}

--
br, Denis F. Latypoff.

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

Организация локейшенов

c350 May 28, 2012 10:58AM

Re: Организация локейшенов

Denis F. Latypoff May 28, 2012 11:04AM

Re: Организация локейшенов

c350 May 28, 2012 11:24AM

Re: Организация локейшенов

c350 May 28, 2012 12:02PM

Re: Организация локейшенов

c350 May 28, 2012 01:06PM

Re: Организация локейшенов

Igor Sysoev May 28, 2012 11:32AM

Re: Организация локейшенов

Igor Sysoev May 28, 2012 12:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 181
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