XF 1.5 Image proxy and Amazon S3

empire

Well-known member
A member is having trouble getting images from Amazon S3 buckets to show up after setting it to allow access on our domain.

This is the error I get when I test their link:
https://username.s3.amazonaws.com/abc/123.jpg could not be fetched or is not a valid image. The specific error message was: Received unexpected response code 403 (Forbidden)

I tested the image on a straight html page on our site and it shows up fine, but it doesn't show on the forum. Is there some change they need to make for the link to work with the image proxy?
 
The S3 servers are actively rejecting the request. It could be something that's being blocked for various reasons (requesting IP, the user agent being used, other specific headers being sent or not sent). For the most part, these aren't really something that is configurable within XF, so if there are configurable restrictions on how the elements within the bucket can be accessed, that might be where further changes need to be made.
 
The blocking is being done on the other end, so unfortunately it's unlikely. They may have access to logs which will give more details.
 
The member has said:
So then the problem is probably with the HTTP referrer header that your PHP proxy script send when requesting the image.
For example, here is an image link: https://membername.amazonaws.com/abc/xyz/123.jpg

In my bucket policy I have specified the allowed referrers as follows:
"https://forumname.com/*",
"https://www.forumname.com/*",
"https://*.forumname.com/*"

No empty referrer is allowed, so when you try to access the image directly it doesn't show. I have also allowed other websites to be referrers and when posted on those the image works without any problem.

Is there any reason why those referrers wouldn't work with the proxy when they do work if linked directly from the site outside the proxy?
 
If they're saying that you must provide a referrer header, then the image proxy does not provide a referrer header. They would need to allow the image if there isn't a referrer provided.
 
Sorry for bringing this up again, but the member is asking us once more. Their question is:
Is it possible to add a referrer? All the other forums do this correctly and images are showing up.

Would this be a suggestion for a feature request in XF, or is there a setting somewhere that we can change on our own?
 
Back
Top Bottom