You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.8 KiB
64 lines
1.8 KiB
server {
|
|
listen 80;
|
|
server_name dropzone.example.com;
|
|
|
|
# HTTP → HTTPS redirect
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name dropzone.example.com;
|
|
|
|
ssl_certificate /etc/nginx/certs/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/certs/privkey.pem;
|
|
|
|
# --- Large files: upload up to 6GB ---
|
|
client_max_body_size 6g;
|
|
|
|
# Long timeouts for large uploads (5GB on slow connections)
|
|
proxy_read_timeout 3600s;
|
|
proxy_send_timeout 3600s;
|
|
proxy_connect_timeout 60s;
|
|
|
|
# --- Frontend (Vue 3 built to /app/frontend/dist) ---
|
|
location / {
|
|
root /app/frontend/dist;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# --- Backend API ---
|
|
location /api/ {
|
|
proxy_pass http://backend:8080;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_buffering off; # important for large files
|
|
proxy_request_buffering off; # do not buffer uploads in Nginx
|
|
}
|
|
|
|
# --- tus: resumable upload of large files ---
|
|
location /files/ {
|
|
proxy_pass http://backend:8080;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
|
|
# Required by the tus protocol
|
|
proxy_http_version 1.1;
|
|
}
|
|
|
|
# --- Direct file serving via Nginx (X-Accel-Redirect) ---
|
|
# Backend returns X-Accel-Redirect header instead of streaming the file
|
|
location /internal/public/ {
|
|
internal;
|
|
alias /mnt/dysk/public/;
|
|
}
|
|
|
|
location /internal/userfiles/ {
|
|
internal;
|
|
alias /mnt/dysk/;
|
|
}
|
|
}
|
|
|