Nginx常用命令及配置
Nginx 禁止某个IP地址访问页面 项目部署在互联网,仅允许指定IP地址访问页面 location /xxx_web/ { allow 49.73.154.142; # 允许第一个IP访问 allow 192.168.1.100; # 允许第二个IP访问 allow 203.0.113.0/24; # 允许整个子网访问 deny all; # 拒绝所有其他IP访问 root html/prod1.juxinbox.com/; try_files $uri $uri/ /index.html; index index.html index.htm;} nginx worker_cpu_affinity 配置 nginx worker_cpu_affinity 配置详解:用于将每个工作进程绑定到特定的CPU核心 Nginx 配置一致性 确保 worker_rlimit_nofile 的值与 worker_processes 和 worker_connections...
SpringBoot项目中Jedis低版本方法不存在报错解决
参考博客: SpringBoot访问Redis报错java.lang.NoSuchMethodError: redis.clients.jedis.JedisPoolConfig.setMinEvictableIdleTime 错误日志:java.lang.NoSuchMethodError: redis.clients.jedis.Jedis.expire(Ljava/lang/String;J)J 错误日志截图 项目中明确引入了高版本Jedis,打包的lib目录下只有jedis-3.x版本 通过命令查询jedis所属模块 mvn dependency:tree 可使用 grep 过滤结果,使用git Bash终端可执行部分linux命令 mvn dependency:tree | grep jedis 解决方式 在web根模块下,移除引入模块的jedis依赖 在web跟模块下,重新引入jedis依赖 验证打包项目中jar版本信息 线上生产环境验证 生产环境项目运行正常,此处无截图
数据库版本过高JAVA应用连接失败问题
解决无法获取数据库连接 java.sql.SQLException: Connections could not be acquired from the underlying database
线上环境问题排查-NoSuchMethodError
参考博客-记录一次NoSuchMethodError 能够解决问题,真实太爽了!希望自己能力慢慢提高,以后也能提供高质量博客帮助到更多的人! 问题排查记录 - NoSuchMethodError 项目中需要启用国密加密方案,于是项目引入maven依赖 <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk15on</artifactId> <version>1.68</version></dependency> 接口加密是使用到了SM2+SM4方式,本地开发环境中接口解密正常,部署至测试环境服务器之后发现项目接口解密报错。 主要报错为sm4的解密,小程序端接口调用日志如下: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError:...
Nginx下配置文件微信校验文件
由于需要在某访问路径下配置微信的file.txt验证文件,特此记录下nginx的配置; root 配置 使用 root 时,是指相对于主配置文件中定义的根目录进行路径拼接 如果 root 指定的是 /var/www/html,那么实际文件应该放在 /var/www/html/xxx/path/usUPk61vXu.txt server { listen 80; server_name www.your_yuming.com; location /xxx/path/usUPk61vXu.txt { root /usr/local/nginx/html; add_header Content-Type text/plain; } location / { # 其他配置 }} alias 配置 alias 时,是直接指定文件的绝对路径 server { listen 80; server_name...
sh脚本备份nginx日志并上传ftp服务器
备份Nginx的log目录下acess.log文件,并上传至ftp服务器 cron定时 0 * * * * . /etc/profile;/bin/sh /usr/local/nginx/logs/backup_accesslog_ftp.sh >> /usr/local/nginx/logs/backup_accesslog_ftp_sh.log 2>&1 sh脚本文件 #!/bin/sh# 备份日志文件目录LOG_DIR="/usr/local/nginx/logs/"# 日志文件LOG_FILE="access.log"# FTP 服务器配置FTP_SERVER="xx.xx.xx.xx"FTP_USER="ftpUser"FTP_PASS="ftpPwd"# 获取当前日期和时间DATE=$(date +'%Y%m%d')# 获取当前时间的上一个小时LAST_UPLOAD_FILE_SUFFIX=$(date -d...
ElementUI组件-upload上传组件使用
部分代码el-table中使用el-upload组件 <el-table :data="tableData" border style="width: 100%"><el-table-column label="转盘图片"> <template scope="scope"> <el-upload class="avatar-uploader" :headers="{ 'Authorization': 'Bearer ' + getToken() }" :action="uploadImgUrl" ...
ElementUI组件-字典使用及回显
字典的使用 <el-radio-group v-model="form.participationConditions"> <el-radio v-for="dict in dict.type.lottery_attend_rule" :key="dict.value" :label=" dict.value " >{{dict.label}}</el-radio> </el-radio-group> export default { dicts: ['limit_attned_time'], data() { return { form: { participationConditions:...
ElementUI组件使用el-date-picker日期选择器使用回显
Element UI中 DatePicker 日期选择器的回显 el-date-picker日期选择器使用赋值,回显,必填等 此处采用的方案二 日期组件的使用 绑定数据对象form.date1 <el-form-item label="活动时间" prop="activeDateTime"> <el-col :span="11"> <el-date-picker v-model="form.date1" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" > </el-date-picker> ...
ruoyi-ui前端配置页面跳转子菜单
参考博客: 若依如何进行页面路由跳转,路由跳转时如何携带参数(超详细图文教程) 创建目标页面的路由 修改前端路由src/router下index.js文件 新建目标页面的路由 { path: '/student', component: Layout, hidden: true, redirect: 'student', children: [ { path: 'studentScore', component: () => import('@/views/qianduan/routerSalta/ScoreCard'), name: 'studentScore', meta: { title: '学生成绩展示' } } ]} path 定义了主路由的路径 component 表示该路由对应的主组件 hidden: true...