{ "urls": "http://*:6001", //web服务端口,如果用IIS部署,把这个去掉 "AllowedHosts": "*", "Startup": { "Domain": "http://localhost:6001", "Cors": { "PolicyName": "CorsIpAccess", //策略名称 "EnableAllIPs": true, //当为true时,开放所有IP均可访问。 // 支持多个域名端口,注意端口号后不要带/斜杆:比如localhost:8000/,是错的;另外http://127.0.0.1:1818 和 http://localhost:1818 是不一样的 "IPs": "http://127.0.0.1:2364,http://localhost:2364,http://127.0.0.1:6688,http://localhost:6688" }, "AppConfigAlert": { "Enabled": true }, "ApiName": "EntrustSettle", "IdentityServer4": { "Enabled": true, // 这里默认是false,表示使用jwt授权模式,如果设置为true,则表示系统使用Ids4模式 "AuthorizationUrl": "http://60.209.125.238:40501", // 认证中心域名 "ApiName": "entrust.settle.api" // 资源服务器 }, "RedisMq": { "Enabled": false //redis 消息队列 } }, // Jwt授权模式需要配置,IdentityServer4模式不需要配置 "Audience": { "Secret": "sdfsdfsrty45634kkhllghtdgdfss345t678fs", //不要太短,16位+ "SecretFile": "C:\\my-file\\entrust.settle.audience.secret.txt", //安全。内容就是Secret "Issuer": "EntrustSettle", "Audience": "wr" }, "Middleware": { "RequestResponseLog": { "Enabled": true, "LogToFile": { "Enabled": true }, "LogToDB": { "Enabled": true } }, "IPLog": { "Enabled": true, "LogToFile": { "Enabled": true }, "LogToDB": { "Enabled": true } }, "RecordAccessLogs": { "Enabled": true, "LogToFile": { "Enabled": true }, "LogToDB": { "Enabled": true }, "IgnoreApis": "/api/test/demo1,/api/test/demo2" }, "SignalR": { "Enabled": false }, "SignalRSendLog": { "Enabled": false }, "IpRateLimit": { "Enabled": false }, "EncryptionResponse": { "Enabled": false, "AllApis": false, "LimitApis": [ "/api/Login/GetJwtTokenSecret" ] }, "EncryptionRequest": { "Enabled": false, "AllApis": false, "LimitApis": [ "/api/Login/GetJwtTokenSecret" ] } }, "AppSettings": { // 是否将日志记录到库中的总开关(包括Sql日志、业务日志) "LogToDb": true, // 缓存 "CachingAOP": { "Enabled": true }, // 服务日志 "LogAOP": { "Enabled": true, "LogToFile": { "Enabled": true }, "LogToDB": { "Enabled": true } }, // 事务 "TranAOP": { "Enabled": true }, // Sql执行日志 "SqlAOP": { "Enabled": true, "LogToFile": { "Enabled": true }, "LogToDB": { "Enabled": true }, // Sql执行日志控制台输出 "LogToConsole": { "Enabled": true } }, "SeedDBEnabled": true, //生成表结构 "RoutePrefix": "", //路由变量前缀配置 "UseLoadTest": false }, // DBType对应:0=MySql,1=SqlServer,2=Sqlite,3=Oracle,4=PostgreSQL,5=Dm,6=Kdbndp // // 主数据库(MainDb):标识当前项目的主数据库。相应连接字符串中的“Enabled”标志必须设置为“true”。 // 从库(Slaves):确保数据库类型一致。可用于读写分离。 // 日志数据库(Log):用于日志记录的数据库。相应连接字符串中的“Enabled”标志必须设置为“true”。 // // 故障转移方案: // 如果主数据库发生故障,将自动切换到备用连接。备用连接的“ConnId”应配置为主数据库的“ConnId”加上一个数字。 // 例如,如果主数据库的“ConnId”为“Main”,那么备用连接的“ConnId”将为“Main1”。 // 主数据库和备用数据库不需要是相同类型。备用数据库将不由程序维护,需要手动维护。 "MainDB": "Main", "DBS": [ { "ConnId": "Main", "DBType": 0, "Enabled": true, "Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;Database=EntrustSettle;Uid=rulesengine_admin;Pwd=Rule1qaz2wsx!QAZ;Port=3306;Allow User Variables=True;Charset=utf8;TreatTinyAsBoolean=false;", "Slaves": [ { "HitRate": 0, // 值越大,优先级越高 0不使用 "Connection": "server=localhost;Database=(unused);Uid=root;Pwd=qwer1234;Port=3306;Allow User Variables=True;Charset=utf8;TreatTinyAsBoolean=false;" } ] }, { "ConnId": "Main2", "DBType": 2, "Enabled": false, "Connection": "(unused).db", "Slaves": [ { "HitRate": 0, // 值越大,优先级越高 0不使用 "Connection": "(unused).db" } ] }, { "ConnId": "Log", //日志库连接固定名称,不可更改 "DBType": 0, "Enabled": true, "HitRate": 50, "Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;Database=EntrustSettleLog;Uid=rulesengine_admin;Pwd=Rule1qaz2wsx!QAZ;Port=3306;Allow User Variables=True;" } ], "Mongo": { "ConnectionString": "mongodb://nosql.data", "Database": "BlogCoreDb" }, "IpRateLimiting": { "EnableEndpointRateLimiting": true, //False: globally executed, true: executed for each "StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter "RealIpHeader": "X-Real-IP", "ClientIdHeader": "X-ClientId", "IpWhitelist": [], //白名单 "EndpointWhitelist": [ "get:/api/xxx", "*:/api/yyy" ], "ClientWhitelist": [ "dev-client-1", "dev-client-2" ], "QuotaExceededResponse": { "Content": "{{\"status\":429,\"msg\":\"访问过于频繁,请稍后重试\",\"success\":false}}", "ContentType": "application/json", "StatusCode": 429 }, "HttpStatusCode": 429, //返回状态码 "GeneralRules": [ //api规则,结尾一定要带* { "Endpoint": "*:/api/entrust*", "Period": "1m", "Limit": 20 }, { "Endpoint": "*/api/*", "Period": "1s", "Limit": 3 }, { "Endpoint": "*/api/*", "Period": "1m", "Limit": 30 }, { "Endpoint": "*/api/*", "Period": "12h", "Limit": 500 } ] }, "Serilog": { "MinimumLevel": { /* Verbose、Debug、Information、Warning、Error、Fatal */ "Default": "Debug", "Override": { "Microsoft": "Debug", "Microsoft.AspNetCore": "Warning", "System": "Warning", "System.Net.Http.HttpClient": "Warning", "Quartz": "Information" } } }, "QuartzNetJob": { "Enabled": false }, "Redis": { "Enable": true, "ConnectionString": "127.0.0.1:6379", "InstanceName": "3" //前缀 }, "RabbitMQ": { "Enabled": true, "Connection": "60.209.125.238:40101/audit_booking", "UserName": "audit_booking_user", "Password": "djy^2024", "RetryCount": 3 }, "Kafka": { "Enabled": false, "Servers": "localhost:9092", "Topic": "entrustsettle", "GroupId": "entrustsettle-consumer", "NumPartitions": 3 //主题分区数量 }, "EventBus": { "Enabled": false, "SubscriptionClientName": "EntrustSettle" } }