nginx / php
I want to have someone request example.com/folder/picture.png
that routes to picture.php which is creating an image
PHP Code:
<?php
$images = ['http://i.imgur.com/ykwcC.jpg','http://i.imgur.com/Urrl4.jpg'];
$i = rand(0,1);
header('Content-Type: image/jpeg');
readfile($images[$i]);
?>
^ for testing
I've tried like 50+ location scripts on stackoverflow etc for nginx, none working.. can't get anything working =/
of course the most familiar example to you guys would be http://www.draynor.net/signatures
nvm got it
literally opposite of what people were posting.......
Code:
location ~ ^/folder/img\.png$ {
rewrite ^/folder/img\.png$ /folder/img.php last;
}