Fix nginx config for certbot workflow
- Remove SSL block that referenced non-existent certificates - HTTP-only config passes nginx -t before certbot - Certbot --nginx will add SSL configuration automatically Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e876a4c967
commit
71ddeacac2
|
|
@ -1,45 +1,13 @@
|
|||
# LetsBe Hub - Nginx Configuration
|
||||
# Place this in /etc/nginx/sites-available/hub.conf
|
||||
# Then: ln -s /etc/nginx/sites-available/hub.conf /etc/nginx/sites-enabled/
|
||||
# And: nginx -t && systemctl reload nginx
|
||||
# Then: nginx -t && systemctl reload nginx
|
||||
# Then: certbot --nginx -d hub.letsbe.solutions
|
||||
|
||||
# Redirect HTTP to HTTPS
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name hub.yourdomain.com;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
# HTTPS server
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name hub.yourdomain.com;
|
||||
|
||||
# SSL certificates (Let's Encrypt)
|
||||
ssl_certificate /etc/letsencrypt/live/hub.yourdomain.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/hub.yourdomain.com/privkey.pem;
|
||||
|
||||
# SSL settings
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
|
||||
ssl_prefer_server_ciphers off;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 1d;
|
||||
|
||||
# Security headers
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
server_name hub.letsbe.solutions;
|
||||
|
||||
# Logging
|
||||
access_log /var/log/nginx/hub.access.log;
|
||||
|
|
@ -64,13 +32,13 @@ server {
|
|||
# Timeouts (longer for SSE streams)
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
proxy_read_timeout 300s; # 5 min for SSE log streaming
|
||||
proxy_read_timeout 300s;
|
||||
|
||||
# Buffering (disable for SSE)
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
|
||||
# Max body size (for file uploads if needed)
|
||||
# Max body size
|
||||
client_max_body_size 50M;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue