Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Xon/XenForo-XARAttachment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#Xenforo-XARAttachment

Enables the use of Nginx's X-Accel-Redirect header feature for attachment serving.

This permits XenForo to-do validation and authentication, and offload the actual file serving to Nginx. This feature is not particularly well documented, but some info found here; http://wiki.nginx.org/X-accel

As XenForo_FileOutput is not extensible, this addon reimplements:

  • XenForo_ViewAdmin_Attachment_View
  • XenForo_ViewPublic_Attachment_View

This addon assumes the /internal_data folder exists within XenForo's webroot.

If not, you may need an nginx config construct similar to:

    location /internal_data {
        internal;
        alias /path/to/internal_data;
    }

And then add in config.php

    config['internalDataUrl'] = '/internal_data';

To ensure you match how XenForo serves files, add the following headers into your site config where appropriate:

    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;

About

Enables the use of Nginx's X-Accel-Redirect for attachment serving.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages