Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Dnebl it seems to me that you are describing the mechanism of the proxy_store
maybe: try_files from here nginx.org/en/docs/http/ngx_http_core_module.html
then think about how to put it all together
Checking the existence of the file nginx.org/ru/docs/http/ngx_http_core_module.html#t...
Passing requests to another server + cache nginx.org/ru/docs/http/ngx_http_proxy_module.html
I use this construction
location / {
root /www/ ;
if ($http_x_mirrored != "yes") {
error_page 404 = @fetch;
}
}
location @fetch {
internal;
proxy_pass http://otherhosts;
proxy_next_upstream error timeout invalid_header http_404;
proxy_store on;
proxy_store_access user:rw group:rw all:rw;
root /www;
proxy_set_header X-Mirrored yes;
expires 30d;
}
Hope it helps, good luck.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question