lumina/nginx.conf
2025-11-29 23:13:05 +03:00

61 lines
1.6 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
# Allow Let's Encrypt challenges
location /.well-known/acme-challenge/ {
root /var/www/html;
}
# Redirect everything else to HTTPS
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
server_name YOUR_DOMAIN; # ← CHANGE THIS
ssl_certificate /etc/nginx/ssl/live/YOUR_DOMAIN/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/live/YOUR_DOMAIN/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location /explorer/public/ {
proxy_pass http://api:3000/explorer/public/;
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 for SSE
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /stream/ {
proxy_pass http://api:3000/stream/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# SSE support
proxy_http_version 1.1;
proxy_set_header Connection '';
proxy_buffering off;
proxy_cache off;
chunked_transfer_encoding off;
}
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
expires -1;
}
gzip on;
gzip_types text/plain application/javascript text/css;
}