aboutsummaryrefslogtreecommitdiff
path: root/nginx.conf
blob: 68efd35f966a75c165bc6da4be10c32a8651f8b5 (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
server {
    listen 6464;

    # Serve React static files
    location / {
        root /usr/share/nginx/html;
        try_files $uri $uri/ /index.html;
    }

    # Proxy API requests to FastAPI
    location /api/ {
        proxy_pass http://localhost:5252;
    }
    # Proxy short link requests to FastAPI
    location /c/ {
        proxy_pass http://localhost:5252;
        set_real_ip_from 0.0.0.0/0;
        real_ip_header X-Forwarded-For;
        real_ip_recursive on;
    }
    # Proxy docs to FastAPI
    location /docs {
        proxy_pass http://localhost:5252/docs;
    }
    # Proxy /openapi.json to FastAPI
    location /openapi.json {
        proxy_pass http://localhost:5252/openapi.json;
    }
}