Welcome! Log In Create A New Profile

Advanced

Block of code if file not found

December 03, 2012 02:02PM
Здравствуйте!

Столкнулась со следующей задачей:
nginx развернут на 2х машинах (может быть n), существуют ресурсы, лежащие на машине #1, с машины #2 нужно настроить прокси таким образом, чтобы в случае, если файл в папке не найден - proxy_path задавался один, если не задан - другой. Файлов много, поэтому конкретный указать нельзя. Пыталась решить эту задачу следующим способом:

location /my-location/ {

proxy_pass http://.......0.1;
#параметры proxy
try_files $request_uri = @notfound;

}

location @notfound{
proxy_pass http://ip.......0.2;
}

Всегда захожу в блок notfound, даже если ресурс по прямой ссылке доступен.

Посоветуйте, что не так или как решить данную задачу лучшим способом?

Спасибо!
Subject Author Posted

Block of code if file not found

nrsk December 03, 2012 02:02PM

Re: Block of code if file not found

Dmitriy Lyalyuev December 04, 2012 02:18AM

Re: Block of code if file not found

nrsk December 04, 2012 02:31AM

Re: Block of code if file not found

nrsk December 04, 2012 04:57AM

Re: Block of code if file not found

Валентин Бартенев December 04, 2012 07:56AM

Re: Block of code if file not found

nrsk December 04, 2012 09:47AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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