60 lines
1.8 KiB
Plaintext
60 lines
1.8 KiB
Plaintext
|
|
# 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;
|
||
|
|
}
|
||
|
|
}
|