Created
August 12, 2016 13:55
-
-
Save tonyfabeen/04af4acb44c4b3d12e0c071d410a5cb4 to your computer and use it in GitHub Desktop.
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
… | |
http { | |
… | |
server { | |
… | |
location /render_imgur { | |
mruby_content_handler_code ' | |
images_from_imgur = ["OiZvLe0b", "3xEanY9b", "JedUbc1b"] | |
request = Nginx::Request.new | |
image = request.args.match(/\d*$/)[0].to_i | |
imgur_url = "http://imgur.com/#{images_from_imgur[image]}" | |
Nginx.redirect imgur_url, Nginx::HTTP_MOVED_TEMPORARILY | |
'; | |
} | |
} | |
… | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment