From 921d22353385cbfc3a0802c00e43ad3013fc0093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl?= Date: Thu, 26 Feb 2026 19:20:03 -0300 Subject: [PATCH] Add preview allowedHosts for faucet.lnpulse.app, add deploy config Made-with: Cursor --- deploy/faucet.lnpulse.app.conf | 54 ++++++++++++++++++++++++++++++++++ frontend/vite.config.ts | 3 ++ 2 files changed, 57 insertions(+) create mode 100644 deploy/faucet.lnpulse.app.conf diff --git a/deploy/faucet.lnpulse.app.conf b/deploy/faucet.lnpulse.app.conf new file mode 100644 index 0000000..69fefdc --- /dev/null +++ b/deploy/faucet.lnpulse.app.conf @@ -0,0 +1,54 @@ +server { + server_name faucet.lnpulse.app; + # No root; all locations are proxied. + + # Increase body size if needed + client_max_body_size 10M; + + # Backend API + location /api/ { + proxy_pass http://127.0.0.1:3001/; + proxy_http_version 1.1; + + 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; + } + + # Health check passthrough + location /health { + proxy_pass http://127.0.0.1:3001/health; + proxy_set_header Host $host; + } + + # Frontend (Vite preview server) + location / { + proxy_pass http://127.0.0.1:5173; + proxy_http_version 1.1; + + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + + listen 443 ssl; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/faucet.lnpulse.app/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/faucet.lnpulse.app/privkey.pem; # managed by Certbot + include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot + +} +server { + if ($host = faucet.lnpulse.app) { + return 301 https://$host$request_uri; + } # managed by Certbot + + + listen 80; + server_name faucet.lnpulse.app; + return 404; # managed by Certbot + + +} + diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 8a2c66e..e131410 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -3,6 +3,9 @@ import react from "@vitejs/plugin-react"; export default defineConfig({ plugins: [react()], + preview: { + allowedHosts: ["faucet.lnpulse.app"], + }, server: { port: 5173, proxy: {