Skip to content

Instantly share code, notes, and snippets.

@nomaster
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nomaster/3d7d6d860571ac6199cc to your computer and use it in GitHub Desktop.
Save nomaster/3d7d6d860571ac6199cc to your computer and use it in GitHub Desktop.
Nginx configuration for X-accel
http {
server {
listen 80;
server_name example.com;
location / {
rewrite ^/download/(.*) /sendfile.php?path=$1 last;
}
location /files {
root /var/www;
internal; # nothing served, except for x-accel-redirect!
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment