diff options
Diffstat (limited to 'scripts/systemd/nginx-fundlab.conf')
| -rw-r--r-- | scripts/systemd/nginx-fundlab.conf | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/scripts/systemd/nginx-fundlab.conf b/scripts/systemd/nginx-fundlab.conf new file mode 100644 index 0000000..e6fdcd4 --- /dev/null +++ b/scripts/systemd/nginx-fundlab.conf @@ -0,0 +1,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; + } + } +} |
