Welcome! Log In Create A New Profile

Advanced

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

May 28, 2012 11:32AM
On Mon, May 28, 2012 at 10:58:00AM -0400, c350 wrote:
> Здравствуйте.
>
> Как более грамотно написать?
>
> Вариант 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 /location1 {
proxy_pass http://127.0.0.10:80/backend_scripts/path/to/script1;
}

location /location2 {
proxy_pass http://127.0.0.10:80/backend_scripts/path/to/script2;
}


--
Igor Sysoev

_______________________________________________
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: 166
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