bebosny
Member
Hello,
My forum runs behind Cloudflare and to prevent the origin IP from being revealed I'm looking to proxy http img embeds of my forum through a different server.
There's some services out there, such as https://images.weserv.nl/ where you can append an image to an URL and it'll proxy it for you (including caching, CDN, etc). It's free too so it seems somewhat unnecessary to host a separate server for image proxying.
It works like this:
Let's say you're trying to proxy this image because it's not HTTPS:
You would convert the URL to this and it would serve over HTTPS:
Initially I thought I could achieve this behaviour using the XenForo config.php proxy option like this:
Unfortunately, the way XF and weserv parse links is a bit different. XenForo will return this as result when reading the URL:
I'm hoping anyone can help without me having to setup a separate proxy server.
Thanks in advance!
My forum runs behind Cloudflare and to prevent the origin IP from being revealed I'm looking to proxy http img embeds of my forum through a different server.
There's some services out there, such as https://images.weserv.nl/ where you can append an image to an URL and it'll proxy it for you (including caching, CDN, etc). It's free too so it seems somewhat unnecessary to host a separate server for image proxying.
It works like this:
Let's say you're trying to proxy this image because it's not HTTPS:
Code:
http://i.imgur.com/FLU5cl6.png
You would convert the URL to this and it would serve over HTTPS:
Code:
https://images.weserv.nl/?url=http://i.imgur.com/FLU5cl6.png
Initially I thought I could achieve this behaviour using the XenForo config.php proxy option like this:
Code:
$config['proxyUrlFormat'] = 'proxy.php?{type}=https://images.weserv.nl/?url={url}';
Unfortunately, the way XF and weserv parse links is a bit different. XenForo will return this as result when reading the URL:
Code:
https://(forumURL)/proxy.php?image=https://images.weserv.nl/?url=http%3A%2F%2Fi.imgur.com%2FFLU5cl6.png
I'm hoping anyone can help without me having to setup a separate proxy server.
Thanks in advance!