Welcome! Log In Create A New Profile

Advanced

Как-бы код покрасивше сделать?

May 30, 2014 02:56PM
Вот такой кусок конфига, но как-то тяжеловато и неоднозначно выглядит, как облагородить?

location ~* ^/download/(.+\.(?:aac|ogg|mp3|wma|wmv|webm|avi|mpe?g|mp4|mpa|asf|rm|rmvb))$ {
internal;
root $root_download_path;
gzip off;
mp4;
mp4_buffer_size 1m;
mp4_max_buffer_size 5m;
rewrite ^/download/(.*)$ $1;
proxy_hide_header X-Accel-Redirect;
add_header ETag $upstream_http_etag;
add_header 'Access-Control-Allow-Origin' '*.pick-nik.ru';
add_header 'Access-Control-Allow-Credentials' 'true';
error_log /var/log/httpd/nginx/off;
access_log /var/log/httpd/nginx/off;
break;
}
location ~* ^/download/(.+\.(?:flv|fla|swf))$ {
internal;
root $root_download_path;
gzip off;
flv;
expires max;
rewrite ^/download/(.*)$ $1;
proxy_hide_header X-Accel-Redirect;
add_header ETag $upstream_http_etag;
add_header Cache-Control public;
add_header 'Access-Control-Allow-Origin' '*.pick-nik.ru';
add_header 'Access-Control-Allow-Credentials' 'true';
error_log /var/log/httpd/nginx/off;
access_log /var/log/httpd/nginx/off;
break;
}
location ~* ^/download/(.+\.(?:rar|zip|tar|gz|lzh|lha|xz|7z|rpm))$ {
internal;
root $root_download_path;
gzip off;
rewrite ^/download/(.*)$ $1;
expires max;
proxy_hide_header X-Accel-Redirect;
add_header ETag $upstream_http_etag;
add_header Cache-Control public;
add_header 'Access-Control-Allow-Origin' '*.pick-nik.ru';
add_header 'Access-Control-Allow-Credentials' 'true';
error_log /var/log/httpd/nginx/off;
access_log /var/log/httpd/nginx/off;
break;
}
Subject Author Posted

Как-бы код покрасивше сделать?

den68 May 30, 2014 02:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 73
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready