Skip to content

Instantly share code, notes, and snippets.

/stream.conf Secret

Created May 20, 2017 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/35641c9c4d851e90e11417d17c17114b to your computer and use it in GitHub Desktop.
Save anonymous/35641c9c4d851e90e11417d17c17114b to your computer and use it in GitHub Desktop.
rewrite ^/test.one.mp3$ /test.two.mp3?$date_gmt redirect;
rewrite ^/test.two.mp3$ /test.three.mp3?$date_gmt redirect;
rewrite ^/test.three.mp3$ /test.mp3?$date_gmt redirect;
location ~ ^/internal_redirect_on/(?P<diskNumber>[\d\w]+)/(?P<dir1>[\w\d])/(?P<dir2>[\w\d])/(?P<dir3>[\w\d])/(?P<dir4>[\w\d])/(?P<dir5>[\w\d])/(?P<dir6>[\w])/(?P<filename>[\w\d\_\.]+)/(?P<download_host>[a-zA-Z\d\-\.]*?)/(?P<fullurl>.*)$ {
internal;
expires max;
set $download_url http://$download_host/$fullurl$is_args$args;
resolver 8.8.8.8;
proxy_set_header Host $download_host;
proxy_set_header Authorization '';
proxy_pass $download_url;
proxy_store C:/nginx/html/cache/$diskNumber/$dir1/$dir2/$dir3/$dir4/$dir5/$dir6/$filename;
proxy_temp_path C:/nginx/html/cache/nginx 2 2;
proxy_store_access user:rw group:rw all:r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment