Created
April 30, 2015 14:55
-
-
Save kopiro/f3e30d485e35f8c3e200 to your computer and use it in GitHub Desktop.
Youtube Thumb server with NGINX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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