aboutsummaryrefslogtreecommitdiff
path: root/nginx_amt-jb.conf
blob: a9f1a9f71c5e32dc8bc0fbcc39bbf42a261b008a (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
upstream uvicorn {
    server 127.0.0.1:8000 max_conns=64;
}

server {
    listen      8080;
    listen [::]:8080;
    server_name jamesbillings67.com www.jamesbillings67.com;
    charset     utf-8;
    real_ip_header      X-Forwarded-For;
    real_ip_recursive   on;

    add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
    expires off;

    # max upload size
    client_max_body_size 1M;   # adjust to taste

    location = /favicon.ico {
        access_log off;
        return 200 '{}';
    }

    location = /nginx_health/ {
        access_log off;
        add_header 'Content-Type' 'application/json';
        return 200 '{"status":"ok"}';
    }

    location = /docs {
        include nginx_amt-jb_proxy_pass.conf;
        proxy_pass http://uvicorn;
    }

    location = /redoc {
        include nginx_amt-jb_proxy_pass.conf;
        proxy_pass http://uvicorn;
    }

    location / {
        # Internally add a trailing slash while preserving the request method and body.
        rewrite ^([^.]*[^/])$ $1/ break;
        include nginx_amt-jb_proxy_pass.conf;
        proxy_pass http://uvicorn;
        add_header Cache-Control "no-store, no-cache, must-revalidate";
    }

}

server {
    listen      8080;
    server_name cdn.jamesbillings67.com;
    include       /etc/nginx/mime.types;

    location / {
        alias /var/www/amt-jb-cdn/;
    }
}