Код: Выделить всё
server {
listen 2221;
listen [::]:2221;
root /var/www/eset_mirror_script/www;
# Add index.php to the list if you are using PHP
index index.html index.htm;
server_name xxx.now.im;
location / {
if ($http_user_agent ~ "^.*Update.*BPC\s+3\..*"){
rewrite ^/update.ver$ /eset_upd/update.ver break;
rewrite ^/eset_upd/update.ver$ /eset_upd/update.ver break;
}
if ($http_user_agent ~* "^.*Update.*BPC\s+(\d?)\..*$"){
set $ver $1;
}
if ($http_user_agent ~* "^.*Update.*BPC\s+(\d+)\..*$"){
set $ver $1;
}
if ($ver = 11) {
set $ver 10;
}
rewrite ^/update.ver$ /eset_upd/v$ver/update.ver break;
rewrite ^/eset_upd/update.ver$ /eset_upd/v$ver/update.ver break;
}
access_log /var/www/eset_mirror_script/log/nginx-access.log;
error_log /var/www/eset_mirror_script/log/nginx-error.log;
}