Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx compatability #28

Open
non7top opened this issue Mar 11, 2014 · 0 comments
Open

nginx compatability #28

non7top opened this issue Mar 11, 2014 · 0 comments

Comments

@non7top
Copy link

non7top commented Mar 11, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant