Welcome! Log In Create A New Profile

Advanced

Подскажите как лучше сделать try_files + proxy_cache

kpoxa
December 08, 2014 12:00PM
Добрый день.



Надо сделать 2 кеша на 2 дисках для 2 разных локейшенов, но с try_files
локальных файлов.


Вариант

server {
server_name server80;
listen 80;
root /etc/nginx/html;
try_files $uri @local;
location @local {
internal;
proxy_pass http://localhost80:800;
}
}
server {
server_name local800;
listen 127.0.0.1:800;
location /1/ {
proxy_cache1;
proxy_pass http://server1;
}
location /2/ {
proxy_cache2;
proxy_pass http://server2;
}
}

Гоняет трафик через лупбэк почем зря.
А в @локейшен вложенные локейшены делать нельзя.


--
Рустам
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Подскажите как лучше сделать try_files + proxy_cache

kpoxa December 08, 2014 12:00PM

Re: Подскажите как лучше сделать try_files + proxy_cache

Maxim Dounin December 08, 2014 12:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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