summaryrefslogtreecommitdiff
path: root/scripts/systemd/nginx-fundlab.conf
blob: e6fdcd42c0cb5ae064c1005c0ca688ad33787388 (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
59
60
61
62
63
64
65
66
67
68
69
70
# fund-lab production gateway (run as the unprivileged user; high ports only).
# Serves the built frontend from src/FundLab.Web/dist on both the frontend port
# (5176) and the cloudflared tunnel origin port (8098), and reverse-proxies
# /api and /health to the fund-lab API on 127.0.0.1:5080.

worker_processes 1;
pid /home/somhairle/projects/fund-lab/var/fund-lab/nginx.pid;
error_log /home/somhairle/projects/fund-lab/var/fund-lab/nginx-error.log warn;

events {
    worker_connections 256;
}

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    access_log /home/somhairle/projects/fund-lab/var/fund-lab/nginx-access.log;

    client_body_temp_path /home/somhairle/projects/fund-lab/var/fund-lab/nginx-tmp/client;
    proxy_temp_path       /home/somhairle/projects/fund-lab/var/fund-lab/nginx-tmp/proxy;
    fastcgi_temp_path     /home/somhairle/projects/fund-lab/var/fund-lab/nginx-tmp/fastcgi;
    uwsgi_temp_path       /home/somhairle/projects/fund-lab/var/fund-lab/nginx-tmp/uwsgi;
    scgi_temp_path        /home/somhairle/projects/fund-lab/var/fund-lab/nginx-tmp/scgi;

    upstream fundlab_api {
        server 127.0.0.1:5080;
    }

    server {
        listen 127.0.0.1:5176;
        server_name _;
        root /home/somhairle/projects/fund-lab/src/FundLab.Web/dist;
        index index.html;

        location = /health {
            proxy_pass http://fundlab_api;
            proxy_set_header Host $host;
        }

        location /api/ {
            proxy_pass http://fundlab_api;
            proxy_set_header Host $host;
        }

        location / {
            try_files $uri /index.html;
        }
    }

    server {
        listen 127.0.0.1:8098;
        server_name _;
        root /home/somhairle/projects/fund-lab/src/FundLab.Web/dist;
        index index.html;

        location = /health {
            proxy_pass http://fundlab_api;
            proxy_set_header Host $host;
        }

        location /api/ {
            proxy_pass http://fundlab_api;
            proxy_set_header Host $host;
        }

        location / {
            try_files $uri /index.html;
        }
    }
}