Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created April 30, 2015 14:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kopiro/f3e30d485e35f8c3e200 to your computer and use it in GitHub Desktop.
Save kopiro/f3e30d485e35f8c3e200 to your computer and use it in GitHub Desktop.
Youtube Thumb server with NGINX
server {
server_name youtube.flerovio.dev;
location @404 {
return 302 /sq$request_uri;
}
error_page 404 = @404;
location ~ /sq/(.+) {
proxy_intercept_errors off;
proxy_redirect off;
resolver 8.8.8.8;
proxy_pass http://img.youtube.com/vi/$1/hqdefault.jpg;
}
location ~ /(.+) {
proxy_intercept_errors on;
proxy_redirect off;
resolver 8.8.8.8;
proxy_pass http://img.youtube.com/vi/$1/maxresdefault.jpg;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment