File size: 1,206 Bytes
d6f27e0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Nginx site for the Notestack API on a Droplet that already runs other backends.
#   sudo cp /opt/notestack/deploy/nginx-notestack.conf /etc/nginx/sites-available/notestack
#   sudo ln -s /etc/nginx/sites-available/notestack /etc/nginx/sites-enabled/notestack
#   sudo nginx -t && sudo systemctl reload nginx
#   sudo certbot --nginx -d api.notestack.ai        # adds HTTPS and the 443 server block
# The API container listens on 127.0.0.1:8010 (API_PORT in deploy/.env.prod).

server {
    listen 80;
    listen [::]:80;
    server_name api.notestack.ai;

    # Voice samples, PDFs and other uploads.
    client_max_body_size 220m;

    location / {
        proxy_pass http://127.0.0.1:8010;
        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_set_header Connection "";

        # Job progress and chat are server sent events: stream them, do not buffer or time out early.
        proxy_buffering off;
        proxy_cache off;
        proxy_read_timeout 3600s;
        proxy_send_timeout 3600s;
    }
}