Large file downloading service based on Nginx, Spring Boot and SQLite(or MySQL)
This is a large file (typically GB in size) downloading service based on Nginx, Spring Boot and SQLite(or MySQL). Dynamically adding more files and more Nginx nodes are supportive, which simply requires some registration steps on the administraion Web pages. What's more, the fundamental support from Nginx is X-Accel.
If this program runs in the default mode (SQLite and application.properties are used), then two accounts already exist. One is admin, whose password is changeme. The other is alice, whose password is test.
sudo mkdir -p /usr/local/var/www
sudo cp -r ./app/external/var/www/protected /usr/local/var/www/
The complete nginx.conf can be found here.
# 1. enable sendfile
sendfile on;
# 2. configure for this project
location /protected/ {
charset utf-8;
root /usr/local/var/www;
internal;
}
location / {
proxy_pass http://127.0.0.1:58080/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
# install the Docker image named 'localhost/nfd' into your local Docker repo,
# or you can type in shell: docker build -t localhost/nfd
sh docker_build.sh
# run the program with default ports assignment
docker run -d -p 58080:58080 -p 58081:58081 localhost/nfd
Requirements
Build
sh build.sh
Run
cd build
sh startup.sh
Go back to main page, and click "My Download Task List".