Welcome! Log In Create A New Profile

Advanced

Re: Block of code if file not found

Dmitriy Lyalyuev
December 04, 2012 02:18AM
Доброе утро.

Вероятно надо так:

try_files $uri @notfound;

http://nginx.org/ru/docs/http/ngx_http_core_module.html#try_files

03.12.2012 21:02, nrsk пишет:
> Здравствуйте!
>
> Столкнулась со следующей задачей:
> 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, даже если ресурс по прямой ссылке доступен.
>
> Посоветуйте, что не так или как решить данную задачу лучшим способом?
>
> Спасибо!
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?21,233516,233516#msg-233516
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
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: 309
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