22# Frappe Meet — Nginx Configuration
33# ==============================================================================
44# Variables substituted at container start by nginx:alpine entrypoint:
5- # $DOMAIN, $SFU_DOMAIN, $FRAPPE_UPSTREAM, $SFU_UPSTREAM
5+ # $DOMAIN, $FRAPPE_UPSTREAM, $SFU_UPSTREAM
6+ #
7+ # Routing:
8+ # https://DOMAIN/sfu/ → SFU server (path prefix stripped)
9+ # https://DOMAIN/ → Frappe
610# ==============================================================================
711
812map $http_upgrade $connection_upgrade {
@@ -14,7 +18,7 @@ map $http_upgrade $connection_upgrade {
1418server {
1519 listen 80;
1620 listen [::]:80;
17- server_name ${DOMAIN} ${SFU_DOMAIN} ;
21+ server_name ${DOMAIN};
1822
1923 location /.well-known/acme-challenge/ {
2024 root /var/www/certbot;
@@ -25,7 +29,7 @@ server {
2529 }
2630}
2731
28- # ── HTTPS: Frappe Meet ───────────────────────────────────────────────────────
32+ # ── HTTPS ───────────── ───────────────────────────────────────────────────────
2933server {
3034 listen 443 ssl;
3135 listen [::]:443 ssl;
@@ -43,40 +47,11 @@ server {
4347
4448 client_max_body_size 50m;
4549
46- location / {
47- proxy_pass http://${FRAPPE_UPSTREAM};
48- proxy_http_version 1.1;
49- proxy_set_header Upgrade $http_upgrade;
50- proxy_set_header Connection $connection_upgrade;
51- proxy_set_header Host $host;
52- proxy_set_header X-Real-IP $remote_addr;
53- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
54- proxy_set_header X-Forwarded-Proto $scheme;
55- proxy_read_timeout 120s;
56- proxy_send_timeout 120s;
57- proxy_buffering off;
58- }
59- }
60-
61- # ── HTTPS: SFU Server ────────────────────────────────────────────────────────
62- server {
63- listen 443 ssl;
64- listen [::]:443 ssl;
65- server_name ${SFU_DOMAIN};
66-
67- ssl_certificate /etc/letsencrypt/live/${SFU_DOMAIN}/fullchain.pem;
68- ssl_certificate_key /etc/letsencrypt/live/${SFU_DOMAIN}/privkey.pem;
69- ssl_protocols TLSv1.2 TLSv1.3;
70- ssl_prefer_server_ciphers off;
71- ssl_session_cache shared:SFU_SSL:10m;
72- ssl_session_timeout 1d;
73- ssl_session_tickets off;
74-
75- add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
76-
77- # Socket.IO / WebSocket
78- location /socket.io/ {
79- proxy_pass http://${SFU_UPSTREAM};
50+ # ── SFU Server (path-based routing, prefix stripped) ──────────────────
51+ # /sfu/socket.io/... → SFU socket.io
52+ # /sfu/health → SFU health check
53+ location /sfu/ {
54+ proxy_pass http://${SFU_UPSTREAM}/;
8055 proxy_http_version 1.1;
8156 proxy_set_header Upgrade $http_upgrade;
8257 proxy_set_header Connection $connection_upgrade;
@@ -89,25 +64,18 @@ server {
8964 proxy_buffering off;
9065 }
9166
92- # HTTP API & Health
67+ # ── Frappe (everything else) ──────────────────────────────────────────
9368 location / {
94- proxy_pass http://${SFU_UPSTREAM };
69+ proxy_pass http://${FRAPPE_UPSTREAM };
9570 proxy_http_version 1.1;
71+ proxy_set_header Upgrade $http_upgrade;
72+ proxy_set_header Connection $connection_upgrade;
9673 proxy_set_header Host $host;
9774 proxy_set_header X-Real-IP $remote_addr;
9875 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
9976 proxy_set_header X-Forwarded-Proto $scheme;
100- proxy_set_header Upgrade $http_upgrade;
101- proxy_set_header Connection $connection_upgrade;
102- proxy_read_timeout 86400s;
103- proxy_send_timeout 86400s;
77+ proxy_read_timeout 120s;
78+ proxy_send_timeout 120s;
10479 proxy_buffering off;
10580 }
106-
107- location = /health {
108- proxy_pass http://${SFU_UPSTREAM}/health;
109- proxy_http_version 1.1;
110- proxy_set_header Host $host;
111- access_log off;
112- }
11381}
0 commit comments