-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
29 lines (26 loc) · 862 Bytes
/
nginx.conf
File metadata and controls
29 lines (26 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
server {
listen 80;
server_name _;
# React SPA static assets
location /app/ {
alias /usr/share/nginx/html/app/;
try_files $uri $uri/ /app/index.html;
}
# Root → SPA
location = / {
return 301 /app/;
}
# Proxy API + Subsonic + Media to Django
location ~ ^/(rest|api|media|django-admin|static)/ {
proxy_pass http://backend:8000;
proxy_http_version 1.1;
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_read_timeout 300s;
proxy_buffering off;
# Limit upload size to prevent abuse (e.g. huge avatars/uploads).
client_max_body_size 10M;
}
}