File size: 1,231 Bytes
6369784
 
 
 
 
ae8c1ff
d030d00
0164e14
ae8c1ff
6369784
 
 
 
64b7527
6369784
ad08f08
6369784
 
c2c845a
6369784
 
 
 
 
 
 
 
 
ad08f08
6369784
 
 
 
 
 
ad08f08
6369784
 
 
dd0f5ed
6369784
ad08f08
6369784
 
 
ad08f08
 
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Server block
server {
    listen 80;
    server_name localhost;

    # Disable access logging to avoid permission issues
    access_log /dev/stdout;
    error_log /dev/stderr;
    
    # Serve static files
    location / {
        root /usr/share/nginx/html;
        index index.html index.htm;
        try_files $uri $uri/ =404;
    }

    # Proxy API requests to the backend (same container)
    location /api/ {
        proxy_pass http://127.0.0.1:8501/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        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_cache_bypass $http_upgrade;
    }

    # Health check endpoint
    location /health {
        access_log off;
        return 200 "healthy\n";
        add_header Content-Type text/plain;
    }

    error_page 404 /404.html;
    location = /404.html {
        internal;
        root /usr/share/nginx/html;
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
}