XF 1.5 Image proxy issues

Martok

Well-known member
Today I noticed that one member's signature was showing a placeholder. I checked the image URL and it is correct but is the http version. Initially I thought that was the issue as we are now https and I recalled an issue with this with XenForo a while back but that seems to have been fixed with 1.5.11 (I'm on 1.5.14). Changing the URL to the https version works.

The URL is http://www.seniorgamers.net/sigs/spruijt_gta.jpg

However I noticed another sig of a similar format that is still working: http://www.seniorgamers.net/sigs/HaloJ_Warframe550x125.jpg

I also tested with another image hosted on a different domain of mine and this one doesn't work either: http://www.martok.com/sig/martoksig.jpg


I tested all 3 URLs in the image proxy test and they all come back with this error:

could not be fetched or is not a valid image. The specific error message was: Received unexpected response code 404 (Not Found)

Yet if you put these URLs into a browser, they all display (as they are redirected to the https version of the URL).


Finally, I decided to test all 3 images here on XenForo, expecting to get the issue of at least 2 of them showing placeholders as they do on my site. However, all 3 are working (using the exact http URL that's used on my site that's giving the placeholder for 2 of the images). You can see this here:

https://xenforo.com/community/threads/proxy-test.130996/


So basically I'm stumped as to why the image proxy on my site isn't showing 2 of these images (but shows 1 of them) yet on here all 3 are working just fine.

I have changed servers in the last couple of days so I don't know if the issue could be to do with that, though I honestly don't know if the first URL was working or not prior to the server move.
 
The likely cause is that when your server makes a request to itself, it's using a different IP than when an external server makes the request. The virtual host in your web server is likely not listening on this IP, so it goes to some default which of course won't have your files.

You can check this via the command line (on your server) using curl/wget. As a simple test though, try pinging your domain from your server; I guess it'll return 127.0.0.1 (or ::1).

To fix this, you would either need to adjust the DNS so your domain resolves to the external IP (possibly using /etc/hosts) or adjust your web server config so it will load your VHost on this IP.
 
Following your pointers I looked into this further and realised that I'd only set up the nginx site .conf files to listen to 80 and 443 for ipv4 only (ie I'd missed out listening to [::]:80 and [::]:443 for ipv6). Once I added these in and restarted nginx the proxy then all is fine - the image proxy test now runs successfully for these URLs and the proxy images are now showing on my site.

Thanks for the advice. :)
 
Back
Top Bottom