Nginx, xaccelredirect and plugin provided images

I am struggling a bit with using plugin-provided images in a setup with nginx and xaccelrdirect:

  1. everything works nicely for core ressources and user-uploaded files
  2. plugin assesets (css im my case) as the scss to css puts things in the right directory
  3. The plugin-provided images are resolved to …/indicovenv/lib/python-2.7/site-packages/plugin/static
    which works if not using xaccel.
  4. For plugins the nginx config probably would need to point to the site-packages location as well. That’s hard to configure right…
    So my question is: should indico copy such files to static/assets / or similar location instead?

No we don’t want to copy files around during setup or runtime.

Plugin assets are served directly through Indico (they are explicitly excluded from the location aliases), but use xaccel nonetheless. Unless you changed your config to be more restrictive (by default the whole /opt/indico/ folder is allowed for x-accel), this should work fine, since the virtualenv is inside that folder.

FYI, performance-wise there shouldn’t be any noticable difference between serving the files directly from nginx or having indico serve them (since it just send the x-accel header)