summarylogtreecommitdiffstats
path: root/tracefinity.nginx.conf
blob: 8d14c0e41a9142680ebd9f3da4c4e6a603c8a3f2 (plain)
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
30
31
# Example Nginx configuration for Tracefinity
# Place this in /etc/nginx/sites-available/ and symlink to sites-enabled/

server {
    listen 3000;
    client_max_body_size 25m;

    # API and Storage routed to the Uvicorn Backend (120s timeout for STL generation)
    location /api/ {
        proxy_pass http://127.0.0.1:8000;
        proxy_read_timeout 120s;
        proxy_connect_timeout 10s;
        proxy_send_timeout 30s;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

    location /storage/ {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
    }

    # Everything else routed to the Next.js Frontend
    location / {
        proxy_pass http://127.0.0.1:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
}