Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


   


   


   















      :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nginx: proxy_pass, include if, , auth_basic


  • To: <nginx-ru@xxxxxxxxx>
  • Subject: nginx: proxy_pass, include if, , auth_basic
  • From: <subscribe@xxxxxxxxxx>
  • Date: Tue, 27 Nov 2007 13:41:11 +0300
  • Content-language: ru
  • Thread-index: Acgw4gL6W4UV379iTvWqzs4lroKOGw==

!

 

Proxy_pass , URI, .

 

:

map $http_host $my_port {

game.rnd.example.com 8001;

admin.rnd.example.com 8081;

game.msk.example.com 8004;

admin.msk.example.com 8084;

game.test.example.com 8003;

admin.test.example.com 8083;

game.new.example.com 8002;

admin.new.example.com 8082;

}

 

location / {

if ($my_port) {

proxy_pass http://127.0.0.1:$my_port;

break;

}

}

 

?

 

 

.

location / {

if ($http_host ~ rnd\.example\.com$) {

include /path/rnd.example.com/nginx.conf;

}

...

}

, , include if.

 

, .

error_page, GET error_page , ? 405.

location / {

if ($http_host ~ rnd\.example\.com$) {

error_page 404 = @rnd;

}

...

}

location @rnd {

include /path/rnd.example.com/nginx.conf;

}

?

 

, :

 

if ($http_host ~ ^game\.rnd\.example\.com$) {

proxy_pass http://127.0.0.1:8001;

break;

}

if ($http_host ~ ^admin\.rnd\.example\.com$) {

proxy_pass http://127.0.0.1:8081;

break;

}

 

?

 

if ($http_host ~ ^game\.test\.example\.com$) {

proxy_pass http://127.0.0.1:8003;

break;

}

if ($http_host ~ ^admin\.test\.example\.com$) {

proxy_pass http://127.0.0.1:8083;

break;

}

 

auth_basic if , .. , .

 

 

?

 

 



 




Copyright © Lexa Software, 1996-2009.