From 06ed320136e7cb38ba2cd39a5f32e9bb1268610b Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 22 Dec 2025 14:23:24 +0100 Subject: [PATCH] Add nginx configuration for Hub deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Includes: - HTTP to HTTPS redirect - Placeholder SSL certs for initial nginx -t pass - Proxy to Hub API on port 8200 - ACME challenge location for certbot - WebSocket support headers - Usage instructions in comments 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- hub.nginx.conf | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 hub.nginx.conf diff --git a/hub.nginx.conf b/hub.nginx.conf new file mode 100644 index 0000000..67cbd0b --- /dev/null +++ b/hub.nginx.conf @@ -0,0 +1,59 @@ +# Nginx configuration for LetsBe Hub +# Usage: +# 1. Copy to /etc/nginx/sites-available/hub.letsbe.biz +# 2. Create symlink: ln -s /etc/nginx/sites-available/hub.letsbe.biz /etc/nginx/sites-enabled/ +# 3. Create placeholder certs (for initial nginx -t): +# openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ +# -keyout /etc/nginx/placeholder.key -out /etc/nginx/placeholder.crt \ +# -subj "/CN=placeholder" +# 4. Test: nginx -t +# 5. Reload: systemctl reload nginx +# 6. Get real certs: certbot --nginx -d hub.letsbe.biz + +server { + listen 80; + server_name hub.letsbe.biz; + + location / { + return 301 https://$host$request_uri; + } + + location ^~ /.well-known/acme-challenge/ { + alias /var/www/html/.well-known/acme-challenge/; + default_type "text/plain"; + allow all; + } +} + +server { + listen 443 ssl http2; + server_name hub.letsbe.biz; + + # Placeholder certs - certbot will replace these + ssl_certificate /etc/nginx/placeholder.crt; + ssl_certificate_key /etc/nginx/placeholder.key; + + # SSL settings (certbot will add its own) + ssl_protocols TLSv1.2 TLSv1.3; + ssl_prefer_server_ciphers off; + + location / { + proxy_pass http://127.0.0.1:8200; + proxy_redirect off; + 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; + + # WebSocket support (if needed later) + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + + location ^~ /.well-known/acme-challenge/ { + alias /var/www/html/.well-known/acme-challenge/; + default_type "text/plain"; + allow all; + } +}