Commit 8c9f2781 authored by Joshua Tauberer's avatar Joshua Tauberer

owncloud: support MOD_X_ACCEL_REDIRECT_ENABLED

This lets downloads from the file app work.
parent 398b538e
......@@ -72,6 +72,14 @@ server {
client_max_body_size 1G;
fastcgi_buffers 64 4K;
}
location ^~ /cloud/data {
# In order to support MOD_X_ACCEL_REDIRECT_ENABLED, we need to expose
# the data directory but only allow 'internal' redirects within nginx
# so that this is not exposed to the world.
internal;
alias $STORAGE_ROOT/owncloud;
}
location ~ ^/((caldav|carddav|webdav).*)$ {
# Z-Push doesn't like getting a redirect, and a plain rewrite didn't work either.
......@@ -79,13 +87,6 @@ server {
proxy_pass https://$HOSTNAME/cloud/remote.php/$1;
}
# location ^~ /cloud/data {
# internal;
# # Set 'alias' if not using the default 'datadirectory'
# # TODO: Since this is auto generated, we need a better approach!
# alias /home/user-data/owncloud;
# }
rewrite ^/.well-known/host-meta /cloud/public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /cloud/public.php?service=host-meta-json last;
rewrite ^/.well-known/carddav /cloud/remote.php/carddav/ redirect;
......
......@@ -79,6 +79,7 @@ def make_domain_config(domain, template, env):
# Replace substitution strings in the template & return.
nginx_conf = template
nginx_conf = nginx_conf.replace("$STORAGE_ROOT", env['STORAGE_ROOT'])
nginx_conf = nginx_conf.replace("$HOSTNAME", domain)
nginx_conf = nginx_conf.replace("$ROOT", root)
nginx_conf = nginx_conf.replace("$SSL_KEY", ssl_key)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment