This commit is contained in:
2026-01-22 18:31:30 +08:00
commit d703ac3574
46 changed files with 7751 additions and 0 deletions

50
nginx.conf.example Normal file
View File

@@ -0,0 +1,50 @@
# flux-web Nginx 配置示例
#
# 使用方法:
# 1. 将下面配置复制到 /etc/nginx/sites-available/flux-web
# 2. 修改 server_name你的域名和 root项目路径
# 3. 执行ln -s /etc/nginx/sites-available/flux-web /etc/nginx/sites-enabled/
# 4. 测试nginx -t
# 5. 重载systemctl reload nginx
server {
listen 80;
server_name your-domain.com; # ← 改成你的域名
root /var/www/flux-web; # ← 改成项目路径
index index.html;
# 静态资源缓存
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 30d;
}
# 主路由
location / {
try_files $uri $uri/ /index.html;
}
}
# HTTPS 配置(可选,使用 Let's Encrypt 免费证书)
# 先执行apt install certbot python3-certbot-nginx
# 然后执行certbot --nginx -d your-domain.com
# 完整 HTTPS 配置示例:
#
# server {
# listen 443 ssl;
# server_name your-domain.com;
# root /var/www/flux-web;
# index index.html;
#
# ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
#
# location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
# expires 30d;
# }
#
# location / {
# try_files $uri $uri/ /index.html;
# }
# }