Can someone tell me how I can replace the if with try_files that it work as before? Can I do some more optimization here (on production I deactivated access_log)?
server {
listen *:80;
server_name p.domain.com p1.domain.com p2.domain.com;
access_log /srv/log/nginx/p-kflirt/access.log;
error_log /srv/log/nginx/p-kflirt/error.log;
if ($allow_visit = no) {
rewrite ^ /not_available.html break;
}
location / {
root /srv/data/p-kflirt;
proxy_store on;
proxy_store_access user:rw group:r all:r;
proxy_temp_path /tmp/image;
# if local server don't has the photo take it from the other
if (!-f $request_filename)
{
proxy_pass http://10.10.10.121:8080;
}
index index.html index.htm;
expires max;
add_header Cache-Control public;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}