Здравствуйте! Подскажите пожалуйста можно ли как-либо написать первые два
локейшена как один?
location ~ ^/box/(([1-9][0-9]*)x([1-9][0-9]*))/(?:../)?((..).+)$
{
set $box_filename $4;
set $box_newMaxWidth $2;
set $box_newMaxHeight $3;
set $box_cutHeight 0;
root /home/cropbox/www/cache/box;
try_files /$1/$5/$4 @box;
}
location ~
^/box/(([1-9][0-9]*)x([1-9][0-9]*)x([1-9][0-9]*))/(?:../)?((..).+)$
{
set $box_filename $5;
set $box_newMaxWidth $2;
set $box_newMaxHeight $3;
set $box_cutHeight $4;
root /home/cropbox/www/cache/box;
try_files /$1/$6/$5 @box;
}
location @box
{
error_log
/home/cropbox/log/nginx.box.error_log warn;
error_page 404 /img/imagenotfound.png;
error_page 500 502 503 504
/img/imageunavailable.png;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME
/home/cropbox/www/box.php;
fastcgi_param QUERY_STRING
filename=$box_filename&newMaxWidth=$box_newMaxWidth&newMaxHeight=$box_newMaxHeight&cutHeight=$box_cutHeight;
fastcgi_intercept_errors on;
fastcgi_pass unix:/tmp/php.sock;
}