sulu: added nginx conf for fileupload

This commit is contained in:
Suru Dissanaike 2021-06-02 14:57:57 +02:00
parent 64d79c39bc
commit 9f632e96a7
3 changed files with 21 additions and 1 deletions

View file

@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu
PKG_VERSION:=0.2.11
PKG_VERSION:=0.2.12
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/sulu.git

View file

@ -0,0 +1,18 @@
# proxy required for nginx to save the file
location /upload_proxy {
return 200 "File upload is successful \n";
}
location /upload {
limit_except POST { deny all; }
client_body_temp_path /tmp/sulu; # the directory to which uploads will be saved, make sure to create the directory you wish to use
client_body_in_file_only on;
client_body_buffer_size 128K;
client_max_body_size 50M;
proxy_pass_request_headers on;
proxy_set_header X-FILE $request_body_file;
proxy_set_body $request_body_file;
proxy_redirect off;
#proxy_pass is necessary. body is only stored when being passed to middleware, so we are providing a proxy that just returns 200.
proxy_pass http://127.0.0.1:8080/upload_proxy;
}

View file

@ -1,5 +1,7 @@
mkdir -p /tmp/sulu
uci -q set nginx._sulu=server
uci -q add_list nginx._sulu.listen='8080'
uci -q add_list nginx._sulu.listen='[::]:8080'
uci -q add_list nginx._sulu.include='conf.d/sulu.locations'
uci -q set nginx._sulu.root='/sulu'
uci -q set nginx._sulu.server_name='_sulu'