Genesis
This commit is contained in:
58
docs/nginx.conf
Normal file
58
docs/nginx.conf
Normal file
@@ -0,0 +1,58 @@
|
||||
# TSE Monitor — sample nginx reverse-proxy configuration
|
||||
#
|
||||
# Place this file (or include it) in /etc/nginx/sites-available/tsemonitor
|
||||
# then symlink: ln -s /etc/nginx/sites-available/tsemonitor /etc/nginx/sites-enabled/
|
||||
# and reload: nginx -t && systemctl reload nginx
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name monitor.example.com; # ← change to your domain or IP
|
||||
|
||||
# Optional: redirect HTTP → HTTPS (uncomment when TLS is configured)
|
||||
# return 301 https://$host$request_uri;
|
||||
|
||||
# Vite HMR WebSocket (dev mode only — remove in production)
|
||||
location /vite-hmr {
|
||||
proxy_pass http://127.0.0.1:20080;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
# All traffic → monitor.js (Express + Vite middleware on port 20080)
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:20080;
|
||||
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;
|
||||
|
||||
# Timeouts — aggregation backfill can take a moment on startup
|
||||
proxy_read_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
# ── TLS (HTTPS) ──────────────────────────────────────────────────────────────
|
||||
# Uncomment after running: certbot --nginx -d monitor.example.com
|
||||
#
|
||||
# server {
|
||||
# listen 443 ssl http2;
|
||||
# server_name monitor.example.com;
|
||||
#
|
||||
# ssl_certificate /etc/letsencrypt/live/monitor.example.com/fullchain.pem;
|
||||
# ssl_certificate_key /etc/letsencrypt/live/monitor.example.com/privkey.pem;
|
||||
# include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
#
|
||||
# location / {
|
||||
# proxy_pass http://127.0.0.1:20080;
|
||||
# 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;
|
||||
# }
|
||||
# }
|
||||
Reference in New Issue
Block a user