From 7b0da6fcf56637078111f58ea287db9866ad6859 Mon Sep 17 00:00:00 2001 From: Mohamed jameel alabasy Date: Sun, 3 May 2026 06:17:15 +0300 Subject: [PATCH 1/2] added socket layer --- nginx/rythmify-back.duckdns.org.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nginx/rythmify-back.duckdns.org.conf b/nginx/rythmify-back.duckdns.org.conf index 3c187ef..65dbb75 100644 --- a/nginx/rythmify-back.duckdns.org.conf +++ b/nginx/rythmify-back.duckdns.org.conf @@ -47,6 +47,21 @@ server { proxy_cache_bypass $http_upgrade; } + location /socket.io/ { + proxy_pass http://localhost:8080; + proxy_http_version 1.1; + + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_cache_bypass $http_upgrade; + } + location /grafana/ { proxy_pass http://localhost:3000/; proxy_http_version 1.1; From b7c05b6172ac4a30602fa03f5265154e6fa56106 Mon Sep 17 00:00:00 2001 From: Mohamed jameel alabasy Date: Sun, 3 May 2026 06:36:36 +0300 Subject: [PATCH 2/2] fix files --- .claude/settings.local.json | 11 ---------- docs/vm-guide.md | 44 +++++++++++++++++++------------------ nginx/rythmify.conf | 2 -- 3 files changed, 23 insertions(+), 34 deletions(-) delete mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index 72e2bb2..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(Remove-Item \"C:\\\\Users\\\\alaba\\\\OneDrive\\\\Desktop\\\\Rythmify\\\\devops\\\\monitoring\\\\grafana\\\\provisioning\\\\alerting\\\\alerts.yml\" -Force)", - "Bash(Get-ChildItem \"C:\\\\Users\\\\alaba\\\\OneDrive\\\\Desktop\\\\Rythmify\\\\devops\\\\monitoring\\\\grafana\\\\provisioning\\\\alerting\" -ErrorAction SilentlyContinue)", - "Bash(Measure-Object)", - "Bash(Select-Object -ExpandProperty Count)", - "PowerShell(Remove-Item *)" - ] - } -} diff --git a/docs/vm-guide.md b/docs/vm-guide.md index ad0297f..e106b45 100644 --- a/docs/vm-guide.md +++ b/docs/vm-guide.md @@ -8,13 +8,13 @@ Practical reference for navigating and operating the two Azure VMs that run the Two VMs in **Azure UAE North**, connected by a shared VNet (private subnet `10.0.1.0/24`). -| | VM1 — App | VM2 — Database | -|---|---|---| -| **Name** | `rythmify-app-vm` | `rythmify-db-vm` | -| **Public IP** | `20.196.3.253` | `20.233.118.212` | -| **Private IP** | `10.0.1.5` (VNet) | `10.0.1.4` | -| **Size** | B2s_v2 | B2als_v2 | -| **Runs** | Backend container, Redis, full monitoring stack, Nginx | PostgreSQL in Docker | +| | VM1 — App | VM2 — Database | +| -------------- | ------------------------------------------------------ | -------------------- | +| **Name** | `rythmify-app-vm` | `rythmify-db-vm` | +| **Public IP** | `20.196.3.253` | `20.233.118.212` | +| **Private IP** | `10.0.1.5` (VNet) | `10.0.1.4` | +| **Size** | B2s_v2 | B2als_v2 | +| **Runs** | Backend container, Redis, full monitoring stack, Nginx | PostgreSQL in Docker | VM1 handles all public traffic. VM2 is database-only — PostgreSQL is not exposed publicly, only reachable from VM1 via the private VNet address `10.0.1.4:5432`. @@ -23,11 +23,13 @@ VM1 handles all public traffic. VM2 is database-only — PostgreSQL is not expos ## SSH Access **VM1:** + ```bash ssh rythmify@20.196.3.253 -i rythmify-app-vm_key.pem ``` **VM2:** + ```bash ssh rythmify@20.233.118.212 -i rythmify-db-vm_key.pem ``` @@ -43,14 +45,14 @@ chmod 400 rythmify-db-vm_key.pem ## VM1 Folder Structure -| Path | Description | -|---|---| -| `~/devops/` | Cloned DevOps repo — all container configs, compose files, and nginx configs live here | -| `~/devops/monitoring/.env.monitoring` | Monitoring stack secrets — never committed to git | -| `/etc/nginx/sites-available/rythmify-back.duckdns.org.conf` | Active backend Nginx config | -| `/etc/nginx/sites-available/rythmify.duckdns.org.conf` | Active frontend Nginx config | -| `/var/lib/GeoIP/` | MaxMind GeoLite2-Country database (`GeoLite2-Country.mmdb`) | -| `/var/www/rythmify/` | Frontend static files served by Nginx (if applicable) | +| Path | Description | +| ----------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `~/devops/` | Cloned DevOps repo — all container configs, compose files, and nginx configs live here | +| `~/devops/monitoring/.env.monitoring` | Monitoring stack secrets — never committed to git | +| `/etc/nginx/sites-available/rythmify-back.duckdns.org.conf` | Active backend Nginx config | +| `/etc/nginx/sites-available/rythmify.duckdns.org.conf` | Active frontend Nginx config | +| `/var/lib/GeoIP/` | MaxMind GeoLite2-Country database (`GeoLite2-Country.mmdb`) | +| `/var/www/rythmify/` | Frontend static files served by Nginx (if applicable) | --- @@ -152,12 +154,12 @@ curl -s http://172.17.0.1:8081/nginx_status **Azure NSG (Network Security Group) — VM1 inbound rules:** -| Port | Protocol | Access | -|---|---|---| -| 80 | TCP | Public — HTTP (redirected to HTTPS by Nginx) | -| 443 | TCP | Public — HTTPS | -| 22 | TCP | Restricted — SSH (limit to known IPs if possible) | -| All others | — | Denied | +| Port | Protocol | Access | +| ---------- | -------- | ------------------------------------------------- | +| 80 | TCP | Public — HTTP (redirected to HTTPS by Nginx) | +| 443 | TCP | Public — HTTPS | +| 22 | TCP | Restricted — SSH (limit to known IPs if possible) | +| All others | — | Denied | Grafana (3000), Prometheus (9090), Alertmanager (9093), Redis, and the backend (8080) are internal only — they are **not** in the NSG allow list and are only accessible via Nginx proxy or SSH tunnel. diff --git a/nginx/rythmify.conf b/nginx/rythmify.conf index 59a4f6c..01518cc 100644 --- a/nginx/rythmify.conf +++ b/nginx/rythmify.conf @@ -1,4 +1,3 @@ -# Backend — rythmify-back.duckdns.org geoip2 /var/lib/GeoIP/GeoLite2-Country.mmdb { $geoip2_data_country_code country iso_code; } @@ -39,7 +38,6 @@ server { ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; } -# Internal stub_status for nginx-prometheus-exporter server { listen 172.17.0.1:8081; location /nginx_status {