<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p><font face="Arial">Hello all,</font></p>
<p><font face="Arial">I have a 403 error when trying to use the PHP
function getimagesize on nginx based web server:<br>
<br>
list($imageWidth, $imageHeight) =
getimagesize($imagesSource['Main']);</font></p>
<p><font face="Arial">Where $imageSource['Main'] is like:<br>
<br>
<a class="moz-txt-link-freetext"
href="https://mywebsite/include/php/render/canvas/VR/2/image/U35p/ver//bgColor/ffffff/widthMM/300/heightMM/388/aube-sunny.jpg">https://mywebsite/include/php/render/canvas/VR/2/image/U35p/ver//bgColor/ffffff/widthMM/300/heightMM/388/aube-sunny.jpg</a></font></p>
<p><font face="Arial">It's an image generated by PHP-imagick module
and is not locally available. This image can be opened by a
browser with no problem.<br>
<br>
To generate this image which go through 404. Nginx is configured
like that:<br>
<br>
error_page 404 = /url_rewriting.php;<br>
And in the file url_rewriting.php, we analyse the URL to see if
it's real 404 or an image which must be generated:<br>
<br>
if((isset($urlHash[2]) && $urlHash[2] === 'render')) {<br>
...<br>
header('Status: 200 OK', false, 200);<br>
chdir('include/php/render/'.$_GET['render']);<br>
require
('include/php/render/'.$_GET['render'].'/render_img.php');<br>
exit;<br>
}<br>
All is working fine but not the getimagesize from my own server.<br>
<br>
What is strange is that it's working fine on my development
environment which has the same versions of nginx and PHP and
pretty the same configuration.<br>
<br>
It might a configuration issue or a right issue on a certain
file but I don't know where to check.</font></p>
<font face="Arial">Thank you,<br>
Vincent.<br>
<br>
</font>
</body>
</html>