summaryrefslogtreecommitdiff
path: root/scripts/systemd/nginx-fundlab.conf
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-22 07:30:09 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-22 07:30:09 +0800
commit3d95b9c736a4cf59cf26bd9e5c7c3162ee8c0fd7 (patch)
tree843b04ddb0c3307f05cd1b5d26d4d70aec2ff0dc /scripts/systemd/nginx-fundlab.conf
parent6ba727422137b35c00b9bb983e574d23a4d15e24 (diff)
downloadfund-lab-3d95b9c736a4cf59cf26bd9e5c7c3162ee8c0fd7.tar.gz
Add fund-lab production systemd --user units and gateway config (3d-28)
Diffstat (limited to 'scripts/systemd/nginx-fundlab.conf')
-rw-r--r--scripts/systemd/nginx-fundlab.conf70
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;
+ }
+ }
+}