serve datastore over the webserver in the example nginx config

pull/1/head
ansuz 6 years ago
parent 5b0380863e
commit 1853566b1a

@ -67,6 +67,25 @@ server {
proxy_set_header Connection upgrade; proxy_set_header Connection upgrade;
} }
location ^~ /datastore/ {
alias /home/cryptpad/office.cryptpad/data/datastore;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
add_header 'Access-Control-Max-Age' 0;
add_header 'Content-Type' 'application/octet-stream; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
add_header Cache-Control max-age=0;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
add_header 'Access-Control-Expose-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
try_files $uri =404;
}
location ^~ /customize.dist/ { location ^~ /customize.dist/ {
# This is needed in order to prevent infinite recursion between /customize/ and the root # This is needed in order to prevent infinite recursion between /customize/ and the root
} }

Loading…
Cancel
Save