- 新增许可证服务器 (license-server/) - 新增 Agent 部署模块 (flnxi-agent/) - 添加许可证验证和激活页面 - 添加 Harbor 镜像同步脚本 - 更新素材系统支持许可证验证
52 lines
1.6 KiB
Nginx Configuration File
52 lines
1.6 KiB
Nginx Configuration File
# 限制请求速率(防止暴力破解和 DDoS)
|
||
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=10r/s;
|
||
limit_req_zone $binary_remote_addr zone=login_limit:10m rate=1r/s;
|
||
limit_conn_zone $binary_remote_addr zone=conn_limit:10m;
|
||
|
||
server {
|
||
listen 80;
|
||
server_name lic.flnxi.com;
|
||
|
||
# 基础安全头
|
||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||
add_header X-Content-Type-Options "nosniff" always;
|
||
add_header X-XSS-Protection "1; mode=block" always;
|
||
|
||
# 限制连接数
|
||
limit_conn conn_limit 20;
|
||
|
||
# 禁止访问隐藏文件
|
||
location ~ /\. {
|
||
deny all;
|
||
}
|
||
|
||
# 登录接口 - 严格限流(防暴力破解)
|
||
location /api/admin/auth/login {
|
||
limit_req zone=login_limit burst=3 nodelay;
|
||
proxy_pass http://127.0.0.1:9527;
|
||
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;
|
||
}
|
||
|
||
# API 接口 - 普通限流
|
||
location /api/ {
|
||
limit_req zone=api_limit burst=20 nodelay;
|
||
proxy_pass http://127.0.0.1:9527;
|
||
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;
|
||
}
|
||
|
||
# 静态资源和页面
|
||
location / {
|
||
proxy_pass http://127.0.0.1:9527;
|
||
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;
|
||
}
|
||
}
|