Attachment Improvements By Xon

Attachment Improvements By Xon 2.6.1

No permission to download
The nginx's x-accel-redirect feature wouldn't work with S3 without a bunch of work, but configuration of that sort of thing is well outside the scope of support I offer for this add-on
 
Hi Xon

I have internal_data hosted in the webroot, so I just use:

Code:
location ^~ /internal_data {
    internal;
    add_header Etag $upstream_http_etag;
    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;
}

Do i need to add this setting in the config.php file?
If I dom images aren't shown.

Code:
Additionally, config.php requires a internalDataUrl stanza like any externalDataUrl;

$config['internalDataUrl'] = function($externalPath, $canonical)
{
return 'internal_data/..../internal_data/' . $externalPath;
};

Thanks
 
@Xon,
happy to just got this x-accel working......i was a little confused about the latest upgrade tho.....you mention xfmg support being fixed and that it has to do with data directory rather than internaldata......does this mean the server configs and config.php values also should change?

btw, i am one directory downstream from pure root...fwiw...

thank you
 
Last edited:
No, there shouldn't be any configuration changes required.

ok great.....so....just for one final note of clarity....

that will cause nginx to serve ALL images correct? thumbs and full sized, gallery and post? avatars, profile stuff, etc?

thank you
 
No, just attachments. Which does include gallery items.

ok..
thumbs also tho? i really wanted to be clear on that as we are planning for making all in post images thumbs. large and small... so they would be used alot, but full sized also upon click so would benefit and its another case of the data directory right? or...idk....im sorry to ask again anyway, trying to understand fully...

thank you
 
This add-on shouldn't interact with the lightbox code. Can you try disabling add-ons and see if you can isolate which one it is.
 
This add-on shouldn't interact with the lightbox code. Can you try disabling add-ons and see if you can isolate which one it is.

Thanks for your help. I found the reason.

If the attachment is inserted as a thumbnail, it will crop the image.

Screenshot_2020-04-03-09-22-58-946_com.android.chrome.jpgScreenshot_2020-04-03-09-22-42-778_com.android.chrome.jpg

And I have Andy's Remove insert full image add-on (a great one. Recommended) so I got every attached images inserted as thumbnail and that caused the problem.

Screenshot_2020-04-03-09-48-06-736_com.android.chrome.jpg

So is it a bug or does it have something to do the preset attachment dimensions (aspect ratio)? If it is, any cure?

Thanks.
 
How do I know Nginx X-Accel-Redirect is configured correctly and in action?

What I've done:

I've added this in mydomain.ssl.conf file:

Code:
        location ^~ /forums/internal_data {
        internal;
        add_header Etag $upstream_http_etag;
        add_header X-Frame-Options SAMEORIGIN;
        add_header X-Content-Type-Options nosniff;
        }

added the following to config.php:

Code:
$config['internalDataUrl'] = '/forums/internal_data';

then run the command ngxrestart
 
Last edited:
So I reinstalled the forum from scratch. This time the svg attachment doesn't work.

Is it the only place to configure the svg attachment? What else could go wrong?

1586855973400.png

1586856195652.webp
 
How do I know Nginx X-Accel-Redirect is configured correctly and in action?

What I've done:

I've added this in mydomain.ssl.conf file:

Code:
        location ^~ /forums/internal_data {
        internal;
        add_header Etag $upstream_http_etag;
        add_header X-Frame-Options SAMEORIGIN;
        add_header X-Content-Type-Options nosniff;
        }

added the following to config.php:

Code:
$config['internalDataUrl'] = '/forums/internal_data';

then run the command ngxrestart

i believe if it IS NOT working, the full sized embeds will show as broken images....when the setting is turned on in admincp.

what i would like to know however(anyone???) is how to support ALL THUMBNAILS as well by this.....

regards
 
It kinda depends on the svg as not all can have a thumbnail generated, can you share those so I can have a look?
 
What version of XenForo and php are you using? This is working with both XF2.1.7 and XF2.1.8, but thumbnail isn't correctly generated for that svg file.
 
Top Bottom