Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Discord not displaying (preview) images hosted on CPanel
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Discord not displaying (preview) images hosted on CPanel

So, I have a CPanel instance by RackNerd (a provider here) which i simply host few images
some of them are just assets but i also got a LOT of AI generated stuff including porn (users can enter random query).

they used to display correctly

but now they don't anymore

here is a link to a picture if you guys have clue why it is so
https://media.thechemicalworkshop.com/TCWStandsFor/psychedelic fart/1.jpg

i mean the screenshots above are hosted the same way and they work on LET

is it possible i got banned by discord? (because edgy?)
tried with http and https... changed file perms and does not work

i don't know whom to ask, feel like discord will ignore me and racknerd support will tell me it's discord issue... (looks like it lol)

any ideas?

«13

Comments

  • Checked Hot linking protection? Might me the case here. ANd it can even be something related to web server configuration.

  • @TrK said:
    Checked Hot linking protection? Might me the case here. ANd it can even be something related to web server configuration.

    "Hotlink protection is currently disabled. "
    all i see in cpanel

  • Just to be on safe side, have you tried embedding the image instead of direct link?

  • @TrK said: Just to be on safe side, have you tried embedding the image instead of direct link?

    using a bot? nope
    it works with other links tho, i just put in a link and it displays it as an image

  • Then what it looks to me is a web server misconfiguration might be sending something odd in response headers, cross check that and try to load the same image from a newly created subdomain. And i don't think it's a discord issue :)

  • edited February 2023

    Seems to work here

  • @TrK said:
    Then what it looks to me is a web server misconfiguration might be sending something odd in response headers, cross check that and try to load the same image from a newly created subdomain. And i don't think it's a discord issue :)

    same issue :(
    https://media2.thechemicalworkshop.com/1.png

    not sure what response headers it even needs, not sure what to tell racknerd support...
    i was thinking to switching the CPanel, because of location and the pics are spicy

  • I don't think Discord has any sort of blocklist of embeds. It's more likely that "your" end is blocking it somehow.

    Check your access logs and see what kind of response Discord's requests are being returned. It's possible that Discord is receiving a 403 Forbidden from your hosting or something like that.

    From what I can tell they use Google Cloud for crawling link embeds. The IP I got was: 35.237.4.214, but I also see references to 35.227.62.178 online. The user agent they sent was Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)

  • @Decicus said:
    I don't think Discord has any sort of blocklist of embeds. It's more likely that "your" end is blocking it somehow.

    Check your access logs and see what kind of response Discord's requests are being returned. It's possible that Discord is receiving a 403 Forbidden from your hosting or something like that.

    From what I can tell they use Google Cloud for crawling link embeds. The IP I got was: 35.237.4.214, but I also see references to 35.227.62.178 online. The user agent they sent was Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)

    hm, i looked at logs i can find in cpanel... and i don't see any logs with the header from discord or the ip... no errors either
    is discord just not making these requests? huh? i don't know at this point

  • @DeadlyChemist said:

    @Decicus said:
    I don't think Discord has any sort of blocklist of embeds. It's more likely that "your" end is blocking it somehow.

    Check your access logs and see what kind of response Discord's requests are being returned. It's possible that Discord is receiving a 403 Forbidden from your hosting or something like that.

    From what I can tell they use Google Cloud for crawling link embeds. The IP I got was: 35.237.4.214, but I also see references to 35.227.62.178 online. The user agent they sent was Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)

    hm, i looked at logs i can find in cpanel... and i don't see any logs with the header from discord or the ip... no errors either
    is discord just not making these requests? huh? i don't know at this point

    So I found another website that uses the same hosting server as you (based on the media2 domain you linked). Images from that other website didn't work in Discord either, so you'll have to ask support (I'd include one of the IPs from my previous reply in the support ticket).

    Most likely your provider has just blocked Discord's IPs (or Google's IPs, maybe even multiple different cloud providers' IPs).

  • @Decicus said:

    @DeadlyChemist said:

    @Decicus said:
    I don't think Discord has any sort of blocklist of embeds. It's more likely that "your" end is blocking it somehow.

    Check your access logs and see what kind of response Discord's requests are being returned. It's possible that Discord is receiving a 403 Forbidden from your hosting or something like that.

    From what I can tell they use Google Cloud for crawling link embeds. The IP I got was: 35.237.4.214, but I also see references to 35.227.62.178 online. The user agent they sent was Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)

    hm, i looked at logs i can find in cpanel... and i don't see any logs with the header from discord or the ip... no errors either
    is discord just not making these requests? huh? i don't know at this point

    So I found another website that uses the same hosting server as you (based on the media2 domain you linked). Images from that other website didn't work in Discord either, so you'll have to ask support (I'd include one of the IPs from my previous reply in the support ticket).

    Most likely your provider has just blocked Discord's IPs (or Google's IPs, maybe even multiple different cloud providers' IPs).

    thanks, will ask and let you all know

  • AdvinAdvin Member, Patron Provider

    Try using something like Cloudflare or BunnyCDN in front

  • @Advin said:
    Try using something like Cloudflare or BunnyCDN in front

    Was going to suggest that but then again if it's an error due to cors configuration i doubt it will fix anything.

  • @Advin said:
    Try using something like Cloudflare or BunnyCDN in front

    @TrK said:

    @Advin said:
    Try using something like Cloudflare or BunnyCDN in front

    Was going to suggest that but then again if it's an error due to cors configuration i doubt it will fix anything.

    im using bunny (DNS) and their CDN looks like $$$
    but can try enabling that somehow, not sure how it even works but will try to figure it out today

    but to debug i'll try
    worst case looking for a host of spicy images (cpanel)

  • @Advin said:
    Try using something like Cloudflare or BunnyCDN in front

    https://media2.thechemicalworkshop.com/1.png

    BunnyCDN

    works, but still not on discord

  • TrKTrK Member
    edited February 2023

    @DeadlyChemist said:

    @Advin said:
    Try using something like Cloudflare or BunnyCDN in front

    https://media2.thechemicalworkshop.com/1.png

    BunnyCDN

    works, but still not on discord

    I would suggest you to check what cors permission is your website sending. And what happens when you upload and share a random image from google images.

  • @TrK said:

    @DeadlyChemist said:

    @Advin said:
    Try using something like Cloudflare or BunnyCDN in front

    https://media2.thechemicalworkshop.com/1.png

    BunnyCDN

    works, but still not on discord

    I would suggest you to check what cors permission is your website sending. And what happens when you upload and share a random image from google images.

    not sure how to check that...
    i tried Header set Access-Control-Allow-Origin "*" in cpanel htaccess and fixes nothing (still routed thru Bunny CDN)

    I'm worried i'll have same/similar issue if i go with diff provider

  • JabJabJabJab Member
    edited February 2023

    If you have this via BunnyCDN now you already went with different provider :-)

    BunnyCDN works for embed ( https://deadlychemist-test.b-cdn.net/1.png ), so only test you need to do now is... post the same image on different domain (like even free one), but from the same server - to narrow down this to: my server settings/headers / domain blacklisted.

    EDIT Ah, I don't see any special/problematic headers/settings there - I would assume domain is blacklisted :D

  • @JabJab said:
    If you have this via BunnyCDN now you already went with different provider :-)

    BunnyCDN works for embed ( https://deadlychemist-test.b-cdn.net/1.png ), so only test you need to do now is... post the same image on different domain (like even free one), but from the same server - to narrow down this to: my server settings/headers / domain blacklisted.

    EDIT Ah, I don't see any special/problematic headers/settings there - I would assume domain is blacklisted :D

    same image, same server, different domain
    https://tcw.edu.pl/1.png

    does it mean discord is blocking me or my cpanel/racknerd is blocking discord?

  • FatGrizzlyFatGrizzly Member, Host Rep

    @DeadlyChemist said:

    @JabJab said:
    If you have this via BunnyCDN now you already went with different provider :-)

    BunnyCDN works for embed ( https://deadlychemist-test.b-cdn.net/1.png ), so only test you need to do now is... post the same image on different domain (like even free one), but from the same server - to narrow down this to: my server settings/headers / domain blacklisted.

    EDIT Ah, I don't see any special/problematic headers/settings there - I would assume domain is blacklisted :D

    same image, same server, different domain
    https://tcw.edu.pl/1.png

    does it mean discord is blocking me or my cpanel/racknerd is blocking discord?

    RN might be firewalling google cloud ips, signup for repl.it and try doing a curl req from there(they run on gcp, might give you some insight.)

  • @FatGrizzly said:

    @DeadlyChemist said:

    @JabJab said:
    If you have this via BunnyCDN now you already went with different provider :-)

    BunnyCDN works for embed ( https://deadlychemist-test.b-cdn.net/1.png ), so only test you need to do now is... post the same image on different domain (like even free one), but from the same server - to narrow down this to: my server settings/headers / domain blacklisted.

    EDIT Ah, I don't see any special/problematic headers/settings there - I would assume domain is blacklisted :D

    same image, same server, different domain
    https://tcw.edu.pl/1.png

    does it mean discord is blocking me or my cpanel/racknerd is blocking discord?

    RN might be firewalling google cloud ips, signup for repl.it and try doing a curl req from there(they run on gcp, might give you some insight.)

    i'll ask RN support then, but why didnt it work from Bunny? if you have ideas let me know, will write them a support ticket...

  • JabJabJabJab Member
    edited February 2023

    Yeah, it should work from bunny CDN even if RN<->Discord is somehow blocked - things went via Bunny so that RN<->Discord connection has nothing to do with it.

    Did you use any of those domains earlier for some embed hosting in Discord? I remember if things not working (like server down) they used to blacklist domains for some hours so they will stop trying to proxy/download images.

    or there is simpler answer: Your Discord account is doing all the bans - the first time you post URL it gets blacklisted, lmao :D

  • @JabJab said:
    Yeah, it should work from bunny CDN even if RN<->Discord is somehow blocked - things went via Bunny so that RN<->Discord connection has nothing to do with it.

    Did you use any of those domains earlier for some embed hosting in Discord? I remember if things not working (like server down) they used to blacklist domains for some hours so they will stop trying to proxy/download images.

    or there is simpler answer: Your Discord account is doing all the bans - the first time you post URL it gets blacklisted, lmao :D

    http://api.thechemicalworkshop.com/

    compleatly different server, works perfectly on discord
    fun fact, if you post this in discord, you can see the embed, and the picture... the picture is direct link to media.thechemicalworkshop.com, which by alone does not work? but in embed does...
    sure if they blacklist my domain, but media2 and the edu one is basically new...

  • hell, someone point a subdomain to 85.195.73.202, i'll try to add it in cpanel and post an image... then see if it works on discord
    but i feel like thats unnessecary, something is wrong, but i don't know what

  • JabJabJabJab Member
    edited February 2023

    Yeah, this works... but do you do any magic/rewrites there? Because the link is http and loads httpS content with broken SSL (because wiki.domain)?

    http://api.thechemicalworkshop.com/ prints all connection headers, only
    httpS://api.thechemicalworkshop.com/ shows TCW Wiki.js with wiki.thechemicalworkshop.com certificate... so I need to manually accept it.

    Did you mess up redirects or changed DNS/NS record lately?

    Yeah, posting httpS://api.thechemicalworkshop.com/ does not generate preview :D
    https://i.imgur.com/qYJUCu4.png

    Oh, I guess this makes sense - httpS link has wrong cert so it's marked as broken, for http it follow redirect to httpS and ignore wrong cert because it was http at the beginning (?)

  • DeadlyChemistDeadlyChemist Member
    edited February 2023

    @JabJab said:

    Yeah, this works... but do you do any magic/rewrites there? Because the link is http and loads httpS content with broken SSL (because wiki.domain)?

    http://api.thechemicalworkshop.com/ prints all connection headers, only
    httpS://api.thechemicalworkshop.com/ shows TCW Wiki.js with wiki.thechemicalworkshop.com certificate... so I need to manually accept it.

    Did you mess up redirects or changed DNS/NS record lately?

    it's ment to be http only (legacy reasons funny enough) so https working is meh, im aware it works due to wiki

    here is the code that runs on the API:

    @app.before_request
    async def before():
        # print("@app.before_request")
        if (useragent := request.headers.get("User-Agent")) and ("discord" in useragent):
            supporter_sting = ""
            donator_sting = ""
            sponsor_sting = ""
            for donator in (await (await fetch_donators(app.redis)).get_json()):
                if donator.get('level') == 2: # supporter
                    supporter_sting += f"{donator.get('nickname')}, "
                if donator.get('level') == 3: # donator
                    donator_sting += f"{donator.get('nickname')}, "
                if donator.get('level') == 4: # donator
                    sponsor_sting += f"{donator.get('nickname')}, "
    
            donator_text = ""
            if sponsor_sting:
                sponsor_sting = sponsor_sting[:-2]
                donator_text += f"The Chemical Workshop is powered by: {sponsor_sting}\n"
            if donator_sting:
                donator_sting = donator_sting[:-2]
                donator_text += f"The Chemical Workshop is supported by: {donator_sting}\n"
            if supporter_sting:
                supporter_sting = supporter_sting[:-2]
                donator_text += f"TCW helpers: {supporter_sting}\n"
    
            description_content = \
                f"This API has been created by Matti from The Chemical Workshop\n\n"\
                f"{donator_text}"
            return f'''<meta property="og:type" content="website">
    <meta property="og:title" content="Official The Chemical Workshop API">
    <meta property="og:description" content="{description_content}">
    <meta property="og:image" content="http://media.thechemicalworkshop.com/TCW/logo_main/TCW_logo_space_alpha_mid_q_864x864.png">
    '''
        else:
            pass # do nothing !
    

    a mess i write 2-3 years ago

    i dont think i touched DNS in the last 2-4 weeks, because it used to work 2 weeks or 3 weeks ago

    I have changed everything (2-3 month ago), as i moved servers, but it was working fine on racknerd, now it somehow does not... puzzled...

  • @DeadlyChemist said: hell, someone point a subdomain to 85.195.73.202, i'll try to add it in cpanel and post an image... then see if it works on discord

    Please create dc2.jabluszko.org and dc1.jabluszko.org :D

  • @DeadlyChemist said:
    https://media2.thechemicalworkshop.com/1.png

    BunnyCDN
    works, but still not on discord

    You re-used the same subdomain, so Discord likely cached it as "not working". Like JabJab mentioned.

    Try with a "fresh", never used subdomain proxied through Bunny. Like definitely-not-used-before.thechemicalworkshop.com or something.

    @TrK said:
    I would suggest you to check what cors permission is your website sending. And what happens when you upload and share a random image from google images.

    CORS shouldn't make a difference in regards to Discord embedding, since all embeds are proxied through Discord's infrastructure (to prevent IP leaks of their users), which would mean that any CORS settings that would need to be tweaked would be on Discord's end anyway.

    Not to mention it would probably affect all other Discord embeds if the CORS settings were broken.

  • @Decicus said:

    @DeadlyChemist said:
    https://media2.thechemicalworkshop.com/1.png

    BunnyCDN
    works, but still not on discord

    You re-used the same subdomain, so Discord likely cached it as "not working". Like JabJab mentioned.

    Try with a "fresh", never used subdomain proxied through Bunny. Like definitely-not-used-before.thechemicalworkshop.com or something.

    @TrK said:
    I would suggest you to check what cors permission is your website sending. And what happens when you upload and share a random image from google images.

    CORS shouldn't make a difference in regards to Discord embedding, since all embeds are proxied through Discord's infrastructure (to prevent IP leaks of their users), which would mean that any CORS settings that would need to be tweaked would be on Discord's end anyway.

    Not to mention it would probably affect all other Discord embeds if the CORS settings were broken.

    but then https://tcw.edu.pl/1.png
    should have worked but still didn't

  • @JabJab said:

    @DeadlyChemist said: hell, someone point a subdomain to 85.195.73.202, i'll try to add it in cpanel and post an image... then see if it works on discord

    Please create dc2.jabluszko.org and dc1.jabluszko.org :D

    done, the picture is at /1.png in both
    haven't posted on discord, so they dont cache not working one, your DNS didnt update yet

    fun fact, im polish

    curious if that works...

Sign In or Register to comment.