Skip to content

nginx compatability #28

@non7top

Description

@non7top

Please add an option for a compatability mod with nginx. Two changes are neccesary:

  1. Different header
    -#define AP_XSENDFILE_HEADER "X-SENDFILE"
    +#define AP_XSENDFILE_HEADER "X-Accel-Redirect"
  2. Files are relative to docroot
  • rv = ap_xsendfile_get_filepath(r, conf, file, &translated);
  • /* make file relative */
  • char *docroot = ap_document_root(r);
  • apr_pool_t *mp;
  • apr_pool_create(&mp, NULL);
  • const char *cat_str = apr_pstrcat(mp, docroot, file, NULL);
  • rv = ap_xsendfile_get_filepath(r, conf, cat_str, &translated);
  • apr_pool_destroy(mp);

This patch may be ugly, but seems to be working fine. Would be great if this be controllable by the config directive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions