{ "version": "https://jsonfeed.org/version/1", "title": "涛声依旧", "subtitle": "天下事有难易乎?为之,则难者亦易矣", "icon": "https://blog.jingxiyuan.cn/images/favicon.ico", "description": "天生我材必有用", "home_page_url": "https://blog.jingxiyuan.cn", "items": [ { "id": "https://blog.jingxiyuan.cn/2022/12/05/Win10%E5%BD%BB%E5%BA%95%E5%85%B3%E9%97%ADwsappx%E8%BF%9B%E7%A8%8B/", "url": "https://blog.jingxiyuan.cn/2022/12/05/Win10%E5%BD%BB%E5%BA%95%E5%85%B3%E9%97%ADwsappx%E8%BF%9B%E7%A8%8B/", "title": "Win10彻底关闭wsappx进程", "date_published": "2022-12-05T04:23:00.000Z", "content_html": "
最近重装了家里一台 mini 电脑,把系统升级成了最新的 win10 系统。但是使用起来却异常卡顿,查看任务管理器发现有个 wsappx 进程占用 cpu 严重。于是百度搜索得知它是微软商店的依赖进程,而我根本就用不上,所以直接禁用。
\n本次任务是需要在一个指标图上通过点击标记画出此标记参与计算的数据范围、最高最低值、参考线等等,于是有了以下代码。代码仅供参考,如有错误的地方请指正!
\n
// 箱体指标 | |
const boxDataScope = 300 // 箱体范围 | |
// 黄金线参数 | |
const goldenSectionA = 0.191 | |
const goldenSectionB = 0.382 | |
const goldenSectionC = 0.5 | |
const goldenSectionD = 0.618 | |
const goldenSectionE = 0.809 | |
this.chart.addTechnicalIndicatorTemplate({ | |
\tname: 'custom_box_solid', | |
shortName: '箱体', | |
precision: 2, | |
plots: [ //key 属性的值最好在主图数据范围内,否则 Y 轴的值会跟着变大可能会导致主图变成一条线 | |
{ key: 'max', title: '最高:' }, | |
{ key: 'min', title: '最低:' } | |
], | |
calcParams: [boxDataScope, goldenSectionA, goldenSectionB, goldenSectionC, goldenSectionD, goldenSectionE], | |
calcTechnicalIndicator: (dataList, { params, plots }) => { | |
let allDatas = [] // 所有数据 | |
let selectedDatas = [] // 选中的数据 | |
for (let i = 0; i < dataList.length; i++) { | |
let kLineData = dataList[i] | |
if (new Date(dateConvert(kLineData.timestamp)).getTime() === getGlobalObject('boxId')) { | |
const size = params[0] | |
// 找出当前数据往前的 size 条数据(包含自己) | |
let index = i | |
let startData = index - size + 1 | |
if (startData < 0) { | |
startData = 0 | |
} | |
let endData = index + 1 | |
if (endData >= dataList.length) { | |
endData = dataList.length - 1 | |
} | |
selectedDatas = dataList.slice(startData, endData) | |
} | |
allDatas.push({ | |
timestamp: kLineData.timestamp | |
}) | |
} | |
// 找出选中数据中最高最低差价 | |
let max, min | |
selectedDatas.forEach(function (item) { | |
let value = item.close - item.close2 | |
if (!max || value > max) { | |
max = value | |
} | |
if (!min || value < min) { | |
min = value | |
} | |
}) | |
\t // 返回指标最终数据(未选中的数据用空对象替换) | |
\t // 必须返回和 dataList 一样条数的数据,否则 title 不会显示 | |
return allDatas.map((data, i) => { | |
let item = { | |
} | |
selectedDatas.map((selected, j) => { | |
if (data.timestamp === selected.timestamp) { | |
item.timestamp = selected.timestamp | |
item.max = max | |
item.min = min | |
} | |
}) | |
return item | |
}) | |
}, | |
render: ({ ctx, dataSource, viewport, styles, xAxis, yAxis }) => { | |
if (dataSource.technicalIndicatorDataList.length <= 0) { // 无指标数据则不处理 | |
return | |
} | |
\t // X 轴起始像素 | |
let x = xAxis.convertToPixel(0) | |
let start, end // 标记选中数据的起止位置 | |
dataSource.technicalIndicatorDataList.forEach(function (kLineData, i) { | |
if (kLineData.timestamp) { | |
if (!start) { | |
start = i | |
} | |
if (!end && (i + 1) < dataSource.technicalIndicatorDataList.length && !dataSource.technicalIndicatorDataList[i + 1].timestamp) { | |
end = i | |
} | |
let max = kLineData.max | |
let min = kLineData.min | |
ctx.fillStyle = '#fff' | |
ctx.textBaseline = 'middle' | |
ctx.textAlign = 'center' | |
// 画箱体 | |
\t\t // 箱体颜色 | |
\t\t ctx.strokeStyle = '#DC143C' | |
\t\t //y 轴最高点位置 | |
\t\t let yHigh = yAxis.convertToPixel(max) | |
\t\t //y 轴最低点位置 | |
\t\t let yLow = yAxis.convertToPixel(min) | |
\t\t ctx.beginPath() | |
\t\t // 画笔移动到数据的 x 轴起始点,y 轴最高点 | |
\t\t ctx.moveTo(x, yHigh) | |
if (i === start) { // 如果是第一条数据则需要画一条竖线 | |
ctx.lineTo(x, yLow) // 画竖线 | |
ctx.moveTo(x, yHigh) // 画笔移回 | |
} | |
if (i === end) { // 如果是最后一条数据则需要画一条竖线 | |
ctx.lineTo(x, yLow) // 画竖线 | |
ctx.fillText(max, x + viewport.dataSpace, yHigh) // 标识箱体最高点的值 | |
ctx.moveTo(x, yLow) // 画笔移动到 Y 轴最低点 | |
ctx.fillText(min, x + viewport.dataSpace, yLow) // 标识箱体最低点的值 | |
} else { // 画两条横线,一条在 y 轴最高点,一条在 y 轴最低点 | |
ctx.lineTo(x + viewport.dataSpace, yHigh) //y 轴最高点横线 | |
ctx.moveTo(x, yLow) // 画笔移动到 y 轴最低点 | |
ctx.lineTo(x + viewport.dataSpace, yLow) //y 轴最低点横线 | |
} | |
ctx.stroke() | |
ctx.closePath() | |
// 画黄金线 | |
\t\t // 黄金线颜色 | |
ctx.strokeStyle = '#ffffff' | |
\t\t // 根据黄金线参数计算黄金线的值 | |
let goldenSectionLineA = (max - min) * goldenSectionA + min | |
let goldenSectionLineB = (max - min) * goldenSectionB + min | |
let goldenSectionLineC = (max - min) * goldenSectionC + min | |
let goldenSectionLineD = (max - min) * goldenSectionD + min | |
let goldenSectionLineE = (max - min) * goldenSectionE + min | |
\t\t // 根据黄金线的值获取 Y 轴高度 | |
let yA = yAxis.convertToPixel(goldenSectionLineA) | |
let yB = yAxis.convertToPixel(goldenSectionLineB) | |
let yC = yAxis.convertToPixel(goldenSectionLineC) | |
let yD = yAxis.convertToPixel(goldenSectionLineD) | |
let yE = yAxis.convertToPixel(goldenSectionLineE) | |
ctx.beginPath() | |
\t\t // 画第一条黄金线 | |
ctx.moveTo(x, yA) | |
ctx.lineTo(x + viewport.barSpace / 2, yA) | |
if (i === end) { // 是否最后一条数据,如果是则需要标识黄金线的值 | |
\t\t // 标识第一条黄金线的值 | |
ctx.fillText(goldenSectionLineA.toFixed(2), x + viewport.dataSpace, yA) | |
} | |
\t\t // 画第二条黄金线 | |
ctx.moveTo(x, yB) | |
ctx.lineTo(x + viewport.barSpace / 2, yB) | |
if (i === end) { | |
ctx.fillText(goldenSectionLineB.toFixed(2), x + viewport.dataSpace, yB) | |
} | |
\t\t // 画第三条黄金线 | |
ctx.moveTo(x, yC) | |
ctx.lineTo(x + viewport.barSpace / 2, yC) | |
if (i === end) { | |
ctx.fillText(goldenSectionLineC.toFixed(2), x + viewport.dataSpace, yC) | |
} | |
\t\t // 画第四条黄金线 | |
ctx.moveTo(x, yD) | |
ctx.lineTo(x + viewport.barSpace / 2, yD) | |
if (i === end) { | |
ctx.fillText(goldenSectionLineD.toFixed(2), x + viewport.dataSpace, yD) | |
} | |
\t\t // 画第五条黄金线 | |
ctx.moveTo(x, yE) | |
ctx.lineTo(x + viewport.barSpace / 2, yE) | |
if (i === end) { | |
ctx.fillText(goldenSectionLineE.toFixed(2), x + viewport.dataSpace, yE) | |
} | |
ctx.stroke() | |
ctx.closePath() | |
} | |
\t\t// 计算 X 轴的下一个位置 | |
x += viewport.dataSpace | |
}) | |
} | |
}) |
以上代码只是箱体的指标模版,还需要根据业务逻辑在标记上实现点击事件,然后通过事件动态添加移除箱体指标。
\nTengine 的性能和稳定性已经在大型的网站如淘宝网,天猫商城等得到了很好的检验。它的最终目标是打造一个高效、稳定、安全、易用的 Web 平台。从 2011 年 12 月开始,Tengine 成为一个开源项目。现在,它由 Tengine 团队开发和维护。Tengine 团队的核心成员来自于淘宝、搜狗等互联网企业。
\ntengine 简单来说就是淘宝自己基于 nginx 优化的网页引擎,在 nginx 原先基础上继续保持兼容,同时功能扩展,效率提高,可以看到目前淘宝网在这么多人同时使用的情况下依然稳定,我们足以相信 tengine,由于它是 nginx 的一个分生版本,所以几乎完全兼容 nginx,所以我认为 tengine 是搭建 lnmp 环境的不二之选。
\n首先访问 tengine 官方网站,获取最新的下载地址。
\n wget http://tengine.taobao.org/download/tengine-2.3.3.tar.gz
nginx -V
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_gzip_static_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_uwsgi_module --without-http_scgi_module
\n./configure 后面的参数是上一步获取的
make 或者 make -j 内核数
\n生成的文件在 objs 目录下
停止 nginx 服务 service nginx stop
\n 查看 nginx 目录 whereis nginx
\n 备份旧 nginx mv /usr/sbin/nginx /usr/sbin/nginx.old
\n 拷贝 objs 下的 nginx 替换旧 nginx cp ./objs/nginx /usr/sbin/
\n 备份旧 so 文件
\n拷贝 objs 下的 so 文件替换旧的 so 文件 cp ./objs/*.so /usr/lib/nginx/modules/
nginx -t
如果打印 test is successful 则表示替换成功。
\n然后执行 service nginx start 进行启动即可
由于有时候 nginx 代理的时候,第三方域名对应的 ip 可能发生变化,然而没有提前通知,然而如果不配置什么,nginx 又不能智能解析,因此 nginx 动态解析域名就比较重要。
\n该模块在启动 nginx 的时候会对域名进行一次解析,解析完成后,在 DNS 服务器设定的 TTL 过期时间内不会再次更新,在 TTL 过期后则会再次发起域名解析请求更新域名所对应的 IP 地址。
\n需要在 nginx 的配置文件中的 http 配置域内指定使用的 DNS 服务器,在 upstream 中需要进行域名解析的 server 后面添加 resolve 参数。
\n例:
\nhttp { | |
resolver ip; | |
upstream test { | |
server www.xxx.com:8080 resolve; | |
} | |
server { | |
listen 8080; | |
client_body_buffer_size 10m; | |
server_name localhost; | |
location / { | |
proxy_pass http://test; | |
} | |
} | |
} |
缺点:
\n1、每次解析域名之后,会从 DNS 服务器获取到改 DNS 的 TTL,在 TTL 期限内不会再次解析,所以如果目标域名发生改变,nginx 不会更新解析,知道 TTL 过期。
\n2、DNS 服务器在 http 配置域配置全,不能在 location 中细分指定。
\n在 http 配置域中配置 DNS 服务器,在 upstream 中按照这个模块的格式配置,支持设置每隔多少秒进行一次解析(抓包分析过设置 interval 可指定解析间隔),如果解析失败则使用缓存中的上一次解析结果的 IP 地址访问。
\n例:
\nhttp { | |
resolver ip; | |
upstream test { | |
jdomain www.xxx.com port=8080 interval=10; #指定域名和端口,每隔 10 秒进行一次解析 | |
} | |
server { | |
listen 8080; | |
client_body_buffer_size 10m; | |
server_name localhost; | |
location / { | |
proxy_pass http://test; | |
} | |
} | |
} |
缺点:DNS 服务器只能在 http 配域中全局配置
\n将域名置于变量中,在对 proxy_pass 进行转发的时候域名调用变量,可以按照 valid,设置的时间参数间隔地对变量中的域名进行解析。
\n例:
\nserver { | |
\tlisten 8080; | |
\tclient_body_buffer_size 10m; | |
\tserver_name localhost; | |
\tlocation / { | |
\t\t\tresolver ip valid=3s; | |
\t\t\tset $five \"www.xxx.com:8080\"; | |
\t\t\tproxy_pass http://${five}; | |
\t} | |
\t | |
} |
缺点:upstream 中不支持设置变量,因此后端有多台的时候该方案不可行。
\n在 upstream 中配置 dynamic_resolve,在 location 配置域中指定 NDS 服务器,按照 valid 设置的时间间隔地进行地址解析。只支持 http 模块的动态域名解析
\n例:
\nhttp { | |
upstream test { | |
dynamic_resolve fallback=stale fail_timeout=30s; | |
server www.xxx.com:8080; | |
} | |
server { | |
listen 8080; | |
location / { | |
resolver ip valid=3s; | |
proxy_pass http://test; | |
} | |
\t } | |
} |
缺点:需要将 nginx 的 bin 文件替换为 tengine 的 bin 文件。
\n", "tags": [ "Linux", "服务", "Nginx", "Nginx", "Tengine", "动态域名解析" ] }, { "id": "https://blog.jingxiyuan.cn/2022/11/30/Nginx%E9%85%8D%E7%BD%AEstream%E8%B8%A9%E5%9D%91/", "url": "https://blog.jingxiyuan.cn/2022/11/30/Nginx%E9%85%8D%E7%BD%AEstream%E8%B8%A9%E5%9D%91/", "title": "Nginx配置stream踩坑", "date_published": "2022-11-30T08:09:00.000Z", "content_html": "stream 模块一般用于 TCP/UDP 数据流的代理和负载均衡,可以通过 stream 模块代理转发 TCP 消息。我是用来转发 mysql、gitee 等连接的,有天 ip 发生了变动导致连接不上。前期试过配置 resolver 114.114.114.114 valid=60s; 来动态解析域名,结果 stream 模块不支持 set 函数,这就导致 ip 变动后必须手动重启或者 reload 一下 nginx 才能正常连接。后面经过搜索发现有人说用 Tengine 替代 nginx 可以实现就试了试,结果发现 Tengine 只能实现 http 下的动态域名解析,至此问题依旧。没办法,我只能通过定时任务加脚本判断 ip 是否变动,如果变动就 reload 一下 nginx。
\n#!/bin/bash | |
#使用 crontab -e 命令添加定时任务 */1 * * * * sh /home/xxx/autoReloadNginx.sh | |
home=\"/home/xxx\" #指定 home 路径,如果使用 `pwd` 则 domainIP.txt 生成在当前用户目录下 | |
domain=xxx.xxx.cn | |
IP=`ping -4 -c 4 $domain | grep from | tail -n 1 | awk -F ' ' '{print $4}'` | |
regex=\"\\b(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9])\\b\" | |
if [ `echo $IP | egrep $regex | wc -l` -eq 1 ]; then | |
if [ ! -f \"$home/domainIP.txt\" ]; then | |
touch $home/domainIP.txt | |
echo $IP > $home/domainIP.txt | |
else | |
oldIP=`cat $home/domainIP.txt` | |
if [ \"$IP\" != \"$oldIP\" ]; then | |
nginx -s reload | |
echo $IP > $home/domainIP.txt | |
else | |
echo \"The domain name ip has not changed\" | |
fi | |
fi | |
else | |
echo \"The domain name resolution is incorrect\" | |
fi |
最近接到一个任务是通过 KLineChart✔️8.6.1 实现在一幅图上画两个合约的蜡烛图。研究 api 发现并没有通过配置实现的方法,于是联系作者沟通得知需要自己画图实现。于是有了本篇文章。
\n
let shortName = this.constant.periodTypeEnum.getNameByCode(this.klineType) + ' 合约2:' + this.currentInstrumentId | |
this.chart.addTechnicalIndicatorTemplate({ | |
name: 'custom_candle_solid', | |
shortName: shortName, | |
precision: 2, | |
bar: { | |
\tupColor: '#EF5350', | |
\tdownColor: '#26A69A', | |
\tnoChangeColor: '#888889' | |
}, | |
plots: [ | |
\t{ key: 'open', title: '开: ' }, | |
\t{ key: 'close', title: '收: ' }, | |
\t{ key: 'high', title: '高: ' }, | |
\t{ key: 'low', title: '低: ' } | |
], | |
calcTechnicalIndicator: (dataList, { params, plots }) => { | |
\treturn dataList.map((kLineData, i) => { | |
\t return { | |
\t\tinstrumentId: kLineData.instrumentId, | |
\t\ttimestamp: getDateTime(new Date(kLineData.timestamp)), | |
\t\topen: kLineData.open, | |
\t\tclose: kLineData.close, | |
\t\thigh: kLineData.high, | |
\t\tlow: kLineData.low | |
\t } | |
\t}) | |
}, | |
render: ({ ctx, dataSource, viewport, styles, xAxis, yAxis }) => { | |
\t// X 轴起始像素 | |
\tlet x = xAxis.convertToPixel(0) | |
\tdataSource.technicalIndicatorDataList.forEach(function (kLineData, i) { | |
\t let open = kLineData.open | |
\t let close = kLineData.close | |
\t let high = kLineData.high | |
\t let low = kLineData.low | |
\t // 给蜡烛柱设置颜色 | |
\t if (close > open) { // 涨 | |
\t\tctx.strokeStyle = '#EF5350' | |
\t\tctx.fillStyle = '#EF5350' | |
\t } else if (close < open) { // 跌 | |
\t\tctx.strokeStyle = '#26A69A' | |
\t\tctx.fillStyle = '#26A69A' | |
\t } else { // 未变动 | |
\t\tctx.strokeStyle = '#888889' | |
\t\tctx.fillStyle = '#888889' | |
\t } | |
\t // 获取开盘价 Y 轴像素 | |
\t let openY = yAxis.convertToPixel(open) | |
\t // 获取收盘价 Y 轴像素 | |
\t let closeY = yAxis.convertToPixel(close) | |
\t // 开、收、高、低的 Y 轴像素 | |
\t let priceY = [openY, closeY, yAxis.convertToPixel(high), yAxis.convertToPixel(low)] | |
\t // 从低到高排序 | |
\t priceY.sort(function (a, b) { | |
\t\treturn a - b | |
\t }) | |
\t // 画蜡烛柱上部 | |
\t ctx.fillRect(x - 0.5, priceY[0], 1, priceY[1] - priceY[0]) | |
\t // 画蜡烛柱下部 | |
\t ctx.fillRect(x - 0.5, priceY[2], 1, priceY[3] - priceY[2]) | |
\t // 蜡烛柱高度 | |
\t var barHeight = Math.max(1, priceY[2] - priceY[1]) | |
\t // 画蜡烛柱中部 (viewport.barSpace 蜡烛柱的宽度,随放大缩小操作而变化) | |
\t ctx.fillRect(x - (viewport.barSpace / 2), priceY[1], viewport.barSpace, barHeight) | |
\t // 下一蜡烛柱 X 轴的起始位置(viewport.dataSpace 蜡烛柱的宽度加蜡烛柱之间的间隔,随放大缩小操作而变化) | |
\t x += viewport.dataSpace | |
\t}) | |
} | |
}) |
this.chart.createTechnicalIndicator('custom_candle_solid', true, { id: 'paneId10', dragEnabled: true, height: this.height }) |
今天无意中发现原本能正常增加的 id 突然不变了,查看 sql 发现是取的对应表的自增 id。虽然存到表中的新数据自增 id 变化了,但返回的 id 总是不变。经过查询发现表的自增 id 是存在 information_schema 库中的 tables 表中。tables 表中存储了所有表的对应信息,其中有个 auto_increment 字段存储的就是对应表的下一个自增值。但是 mysql 在新版本中修改了此值的更新规则,老版本中是实时更新,新版本修改为 24 小时更新一次。为了不修改原代码中的逻辑,只能通过修改 mysql 配置使项目正常工作了。
\nmysql数据库auto_increment自增长不变的处理方法 | |
修改/etc/mysql/mysql.conf.d/mysqld.cnf | |
增加一行information_schema_stats_expiry = 0 | |
保存后重启mysql | |
sudo systemctl restart mysql.service | |
查询是否生效 | |
show global variables like 'information_schema_stats_expiry'; | |
show session variables like 'information_schema_stats_expiry'; |
1、运行注册机
\n 2、修改 Your Name(可不改)
\n3、点击 Patch(此时会提示:navicat.exe - x64 -> Cracked)
\n4、运行 navicat
\n5、点击第一个 Generate 获取注册码 (Your Name 上一行)
\n 6、点击 Copy 然后粘贴到 navicat 窗口上(也可能会自动粘贴进去)
\n7、点击 navicat 上的激活按钮,等待一会,失败后会弹出手动激活按钮
\n 8、点击手动激活,窗口上会有一个 request code,把框里的值复制到注册机对应的 request code 框内。
\n9、点击第二个 Generate 获取 Activation Code(激活码),把码复制到 navicat 对应的框内。
\n10、点击激活完成激活。
-vm | |
D:\\jdk-11.0.11\\bin | |
-startup | |
plugins/org.eclipse.equinox.launcher_1.6.300.v20210813-1054.jar | |
--launcher.library | |
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.300.v20210828-0802 | |
-vmargs | |
-XX:+IgnoreUnrecognizedVMOptions | |
--add-modules=ALL-SYSTEM | |
-Dosgi.requiredJavaVersion=11 | |
-Xms128m | |
-Xmx2048m | |
-Djavax.net.ssl.trustStoreType=WINDOWS-ROOT | |
-Ddbeaver.distribution.type=zip | |
-javaagent:F:\\green program\\dbeaver\\dbeaver-agent\\dbeaver-agent.jar |
第一二行指定 jdk 地址
\n最后一行指定 dbeaver-agent.jar 注册工具的位置
.env.alpha
\nNODE_ENV = 'production' | |
VUE_APP_BASE_URL = '/' |
.env.prod
\nNODE_ENV = 'production' | |
VUE_APP_BASE_URL = '/projectName' |
\"scripts\": { | |
\"serve\": \"vue-cli-service serve\", | |
\"build\": \"vue-cli-service build\", | |
\"build-test\": \"vue-cli-service build --mode alpha\", | |
\"build-prod\": \"vue-cli-service build --mode prod\", | |
\"lint\": \"vue-cli-service lint\" | |
} |
项目中 base_url 需要使用 process.env.VUE_APP_BASE_URL 替换
\n编译命令
\nyarn build-test #使用.env.alpha 配置文件中的参数 | |
yarn build-prod #使用.env.prod 配置文件中的参数 | |
yarn build --mode alpha #使用.env.alpha 配置文件中的参数 | |
yarn build --mode prod #使用.env.prod 配置文件中的参数 |
正向代理:如果把局域网外的 Internet 想象成一个巨大的资源库,则局域网中的客户端要访问 Internet,则需要通过代理服务器来访问,这种代理服务就称为正向代理,下面是正向代理的原理图。
\n
\n 反向代理:看下面原理图,就一目了然。其实客户端对代理是无感知的,因为客户端不需要任何配置就可以访问,我们只需要将请求发送到反向代理服务器,由反向代理服务器去选择目标服务器获取数据后,在返回给客户端,此时反向代理服务器和目标服务器对外就是一个服务器,暴露的是代理服务器地址,隐藏了真实服务器 IP 地址。
\n
\n\n正向代理和反向代理的区别,一句话就是:如果我们客户端自己用,就是正向代理。如果是在服务器用,用户无感知,就是反向代理。
\n
在学习 Nginx 之前,要熟知它的配置文件,毕竟,下面需要做的所有配置(反向代理、负载均衡、动静分离等),都是基于它的配置文件。
\nNginx 默认的配置文件是在安装目录下的 conf 目录下,后续对 Nginx 的使用基本上都是对此配置文件进行相应的修改。完整的配置文件,可以看一下文章最后。修改过 nginx.conf 配置文件,记得要✔️重启 Nginx 服务(☆☆☆☆☆)
\n配置文件中有很多 #号,该符号表示注释内容,去掉所有以 #开头的段落,精简之后的配置文件内容如下(PS:其实注释掉的地方,都是一些功能的使用代码,需要用到的时候,取消注释即可):
\n# 主进程叫 master,负责管理子进程,子进程叫 worker | |
# worker_processes 配置项表示开启几个业务进程,一般和 cpu 核数有关 | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
\t# include 表示可以引入其他文件,此处表示引入 http mime 类型 | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
\t# 虚拟主机,可以配置多个 | |
server { | |
listen 80; | |
server_name localhost; | |
location / { | |
\t# 路径匹配之后,哪个目录下去匹配相应的网页,html 是相对路径 | |
root html; | |
index index.html index.htm; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
\t} | |
} |
\n\n去掉注释信息后,可以将 nginx.conf 配置文件分为三部分:
\n
worker_processes 1; |
从配置文件开始到 events 块之间的内容,主要会设置一些影响 Nginx 服务器整体运行的配置指令,主要包括:配置运行 Nginx 服务器的用户(组)、允许生成的 worker process 数,进程 PID 存放路径、日志存放路径和类型以及配置文件的引入等。
\n上面这行 worker_processes 配置,是 Nginx 服务器并发处理服务的关键配置,该值越大,可以支持的并发处理量也越多,但是会受到硬件、软件等设备的约束。
\nevents { | |
\tworker_connections 1024; | |
} |
\n\n上述例子就表示每个 work process 支持的最大连接数为 1024。这部分的配置对 Nginx 的性能影响较大,在实际中应该灵活配置。
\n
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
server { | |
listen 80; | |
server_name localhost; | |
location / { | |
root html; | |
index index.html index.htm; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
} |
http 全局块:http 全局块配置的指令包括:文件引入、MIME-TYPE 定义、日志自定义、连接超时时间、单链接请求数上限等。
\nserver 块:这块和虚拟主机有密切关系,从用户角度看,虚拟主机和一台独立的硬件主机是完全一样的,该技术的产生是为了节省互联网服务器硬件成本。
\nlocation 块:这块的主要作用是:基于 Nginx 服务器接收到的请求字符串(例如 server_name/uri-string),对虚拟主机名称(也可以是 IP 别名)之外的字符串(例如 前面的 /uri-string)进行匹配,对特定的请求进行处理。地址定向、数据缓存和应答控制等功能,还有许多第三方模块的配置也在这里进行。
\n每个 http 块可以包括多个 server 块,而每个 server 块就相当于一个虚拟主机。而每个 server 块也分为全局 server 块,以及可以同时包含多个 locaton 块。(☆☆☆☆☆)
\nlocation [ = | ~ | ~* | ^~ | @ ] /uri { | |
} | |
= :用于不含正则表达式的 uri 前,要求请求字符串与 uri 严格匹配,如果匹配成功,就停止继续向下搜索并立即处理该请求。 | |
~ :用于表示 uri 包含正则表达式,并且区分大小写。 | |
~* :用于表示 uri 包含正则表达式,并且不区分大小写。 | |
^~ :用于不含正则表达式的 uri 前,要求 Nginx 服务器找到标识 uri 和请求字符串匹配度最高的location后,立即使用此 location 处理请求,而不再使用 location 块中的正则 uri 和请求字符串做匹配。 | |
@ : \"@\" 定义一个命名的 location,使用在内部定向时,例如 error_page | |
/uri :不带任何修饰符,也表示前缀匹配,但是在正则匹配之后,如果没有正则命中,命中最长的规则 | |
/ :通用匹配,任何未匹配到其它location的请求都会匹配到,相当于switch中的default |
uri 没有 “/” 结尾时,location /abc/def 可以匹配 /abc/defghi 请求,也可以匹配 /abc/def/ghi 等。
\nuri 有 “/” 结尾时,location /abc/def/ 不能匹配 /abc/defghi 请求,只能匹配 /abc/def/anything 这样的请求☆☆☆☆☆
url 结尾加上了 /,相当于是绝对路径,则 Nginx 不会把 location 中匹配的路径部分加入代理 url。
\nurl 结尾不加 /,Nginx 则会把匹配的路径部分加入代理 uri。
情景1: | |
proxy_pass后有/ | |
访问地址:http://localhost:8081/WCP.Service/wcp/modeladapter/download/asc.shtml | |
最终代理:http://10.194.171.7:13082/modeladapter/download/asc.shtml | |
location /WCP.Service/wcp/modeladapter/download/ { | |
\tproxy_pass http://10.194.171.7:13082/modeladapter/download/; | |
} | |
访问地址:http://localhost:8081/model/asc.shtml | |
最终代理:http://127.0.0.1:8082/model/asc.shtml | |
location /model/ { | |
\tproxy_pass http://127.0.0.1:8082/model/; | |
} | |
情景2: | |
proxy_pass后有/ | |
访问地址:http://localhost:8081/model/asc.shtml | |
最终代理:http://127.0.0.1:8082/asc.shtml | |
location /model/ { | |
\tproxy_pass http://127.0.0.1:8082/; | |
} | |
情景3: | |
proxy_pass后没有/ | |
访问地址:http://localhost:8081/model/asc.shtml | |
最终代理:http://127.0.0.1:8082/model/asc.shtml | |
location /model/ { | |
\tproxy_pass http://127.0.0.1:8082; | |
} | |
情景4 | |
proxy_pass后没有/ | |
访问地址:http://localhost:8081/model/asc.shtml | |
最终代理:http://127.0.0.1:8082/AAAmodel/asc.shtml | |
location /model/ { | |
\tproxy_pass http://127.0.0.1:8082/AAA; | |
} | |
情景5 | |
proxy_pass后有/ | |
访问地址:http://localhost:8081/model/asc.shtml | |
最终代理:http://127.0.0.1:8082/asc.shtml | |
location /model { | |
\tproxy_pass http://127.0.0.1:8082/; | |
} | |
情景6 | |
proxy_pass后有/ | |
访问地址:http://localhost:8081/modelBBB/asc.shtml | |
最终代理:http://127.0.0.1:8082/asc.shtml | |
location /model { | |
\tproxy_pass http://127.0.0.1:8082/; | |
} |
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
#log_format main '$remote_addr - $remote_user [$time_local] \"$request\" ' | |
# '$status $body_bytes_sent \"$http_referer\" ' | |
# '\"$http_user_agent\" \"$http_x_forwarded_for\"'; | |
#access_log logs/access.log main; | |
sendfile on; | |
#tcp_nopush on; | |
#keepalive_timeout 0; | |
keepalive_timeout 65; | |
#gzip on; | |
server { | |
listen 80; | |
server_name localhost; | |
#charset koi8-r; | |
#access_log logs/host.access.log main; | |
location / { | |
root html; | |
index index.html index.htm; | |
} | |
#error_page 404 /404.html; | |
# redirect server error pages to the static page /50x.html | |
# | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
# proxy the PHP scripts to Apache listening on 127.0.0.1:80 | |
# | |
#location ~ \\.php$ { | |
# proxy_pass http://127.0.0.1; | |
#} | |
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 | |
# | |
#location ~ \\.php$ { | |
# root html; | |
# fastcgi_pass 127.0.0.1:9000; | |
# fastcgi_index index.php; | |
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; | |
# include fastcgi_params; | |
#} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
#location ~ /\\.ht { | |
# deny all; | |
#} | |
} | |
# another virtual host using mix of IP-, name-, and port-based configuration | |
# | |
#server { | |
# listen 8000; | |
# listen somename:8080; | |
# server_name somename alias another.alias; | |
# location / { | |
# root html; | |
# index index.html index.htm; | |
# } | |
#} | |
# HTTPS server | |
# | |
#server { | |
# listen 443 ssl; | |
# server_name localhost; | |
# ssl_certificate cert.pem; | |
# ssl_certificate_key cert.key; | |
# ssl_session_cache shared:SSL:1m; | |
# ssl_session_timeout 5m; | |
# ssl_ciphers HIGH:!aNULL:!MD5; | |
# ssl_prefer_server_ciphers on; | |
# location / { | |
# root html; | |
# index index.html index.htm; | |
# } | |
#} | |
} |
sudo apt autoremove --purge nodejs |
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && sudo apt-get install -y nodejs |
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null | |
echo \"deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main\" | sudo tee /etc/apt/sources.list.d/yarn.list | |
sudo apt-get update && sudo apt-get install yarn |
yarn install |
yarn build |
apt install nginx |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
# SSL configuration | |
# | |
# listen 443 ssl default_server; | |
# listen [::]:443 ssl default_server; | |
# | |
# Note: You should disable gzip for SSL traffic. | |
# See: https://bugs.debian.org/773332 | |
# | |
# Read up on ssl_ciphers to ensure a secure configuration. | |
# See: https://bugs.debian.org/765782 | |
# | |
# Self signed certs generated by the ssl-cert package | |
# Don't use them in a production server! | |
# | |
# include snippets/snakeoil.conf; | |
root /var/www/html; | |
# Add index.php to the list if you are using PHP | |
index index.html index.htm index.nginx-debian.html; | |
server_name _; | |
location /api { | |
proxy_pass http://localhost:8080; | |
} | |
location / { | |
# First attempt to serve request as file, then | |
# as directory, then fall back to displaying a 404. | |
#try_files $uri $uri/ =404; | |
alias /opt/codes/dayu-tools-arbitrage-web/dist/; | |
index index.html index.htm; | |
} | |
} |
rm dist -fr | |
yarn build |
2>/dev/null |
意思就是把错误输出到 “黑洞”
\n>/dev/null 2>&1 |
默认情况是 1,也就是等同于 1>/dev/null 2>&1。意思就是把标准输出重定向到 “黑洞”,还把错误输出 2 重定向到标准输出 1,也就是标准输出和错误输出都进了 “黑洞”
\n2>&1 >/dev/null |
意思就是把错误输出 2 重定向到标准出书 1,也就是屏幕,标准输出进了 “黑洞”,也就是标准输出进了黑洞,错误输出打印到屏幕
\n文件描述符
\n Linux 系统预留三个文件描述符:0、1 和 2,他们的意义如下所示:
\n0—— 标准输入(stdin)
\n略...
\n1—— 标准输出(stdout)
\n在当前目录下,有且只有一个文件名称为 a.txt 的文件,这时我们运行这个命令【ls a.txt】, 就会获得一个标准输出 stdout 的输出结果:a.txt
\n
\n2—— 标准错误(stderr)
\n在当前目录下,有且只有一个文件名称为 a.txt 的文件,我们运行命令【ls b.txt】,我们就会获得一个标准错误 stderr 的输出结果 “ls:无法访问 b.txt:没有这样的文件或目录”。
\n
重定向
\n重定向的符号有两个:> 或 >>,两者的区别是:前者会先清空文件,然后再写入内容,后者会将重定向的内容追加到现有文件的尾部。举例如下:
重定向标准输出 stdout
\n
\n 如上图所示,对比没有添加重定向的操作,这条命令在使用之后并没有将 a.txt 打印到屏幕。在紧接的 cat 操作后,可以发现本来应该被输出的内容被记录到 stdout.txt 中。
重定向标准错误 stderr
\n
\n 如上图所示,文件描述符 2,标准错误的重定向也是同样的原理被记录在了文件 stderr.txt 这个文件里面了。
可以将 stderr 单独定向到一个文件,stdout 重定向到另一个文件
\nls b.txt 2> stderr.txt 1>stdout.txt |
ls b.txt > output.txt 2>&1 |
ls b.txt &> output.txt | |
ls b.txt >& output.txt #两个表达式效果一样的 |
\n360 全家桶众说纷纭但工具箱还是挺实用的,这波小工具可以单独下载使用,有需要的朋友赶紧下载吧!
下载地址
\n
\n
\n
win10 / win11 / 本地
\n", "tags": [ "Windows", "工具", "Windows10", "Windows11", "自动更新" ] }, { "id": "https://blog.jingxiyuan.cn/2022/10/27/%E6%9E%81%E7%A9%BA%E9%97%B4web%E7%AB%AFhttps%E7%9B%B4%E8%BF%9Enginx%E9%85%8D%E7%BD%AE/", "url": "https://blog.jingxiyuan.cn/2022/10/27/%E6%9E%81%E7%A9%BA%E9%97%B4web%E7%AB%AFhttps%E7%9B%B4%E8%BF%9Enginx%E9%85%8D%E7%BD%AE/", "title": "极空间web端https直连nginx配置", "date_published": "2022-10-27T05:34:00.000Z", "content_html": "server { | |
\t\tif ($scheme = http) { | |
\t\t\trewrite ^(.*)$ https://$host$1 permanent; | |
\t\t} | |
} |
#极空间 - web | |
server { | |
\tlisten 10000 ssl http2; #ipv4 | |
\tlisten [::]:10000 ssl http2; #ipv6 | |
\tserver_name xxx.xxx.com; #填写自己的域名,主域名或者子域名 | |
\t#include /etc/nginx/conf.d/ssl/ssl_common.conf; | |
\tssl_certificate_key /etc/nginx/conf.d/ssl/xxx.key; #加密证书 | |
\tssl_certificate /etc/nginx/conf.d/ssl/xxx.pem; #加密证书 | |
\tssl_session_timeout 1d; | |
\tssl_session_cache shared:MozSSL:10m; | |
\tssl_session_tickets off; | |
\tssl_protocols TLSv1.2 TLSv1.3; | |
\tssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; | |
\tssl_prefer_server_ciphers on; | |
#开启 OCSP stapling | |
\tssl_stapling on; | |
\tssl_stapling_verify on; | |
\tclient_max_body_size 128M; | |
\tadd_header Strict-Transport-Security \"max-age=31536000; includeSubdomains; preload\"; | |
\tproxy_send_timeout 180s; #设置发送超时时间 | |
proxy_read_timeout 180s; #设置读取超时时间 | |
\t# Prevent Information leaks | |
\tproxy_hide_header X-Powered-By; | |
\tproxy_hide_header Server; | |
\tproxy_hide_header X-AspNetMvc-Version; | |
\tproxy_hide_header X-AspNet-Version; | |
\t# http security headers | |
\tadd_header X-Content-Type-Options nosniff; | |
\tadd_header Pragma no-cache; | |
\tadd_header Cache-Control no-store; | |
\tadd_header X-XSS-Protection \"1; mode=block\"; | |
\tadd_header Referrer-Policy origin-when-cross-origin; | |
\tadd_header X-Permitted-Cross-Domain-Policies none; | |
add_header X-Frame-Options SAMEORIGIN; #允许同域嵌套 | |
\t# Add Security cookie flags | |
\tproxy_cookie_path ~(.*) \"$1; SameSite=strict; secure; httponly\"; | |
\t# Path to the root of your installation | |
\tlocation / { | |
\t\tproxy_intercept_errors on; | |
\t\tproxy_max_temp_file_size 0; | |
\t\tproxy_set_header Host $host; | |
\t\tproxy_set_header X-Real-IP $remote_addr; | |
\t\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
\t\tproxy_set_header X-Forwarded-Proto $scheme; | |
\t\tproxy_pass http://极空间内网ip:5055; #这里设置你自己要跳转的局域网应用; | |
\t\tproxy_redirect http://域名:5055/home https://域名:10000/home; #极空间在登陆后会跳转到 http 协议的 5055 端口,所以要在此替换为 https 协议的 10000 端口 | |
\t} | |
\terror_page 500 502 503 504 /500.html; | |
\terror_page 400 404 /500.html; | |
\tlocation = /500.html { | |
\t\troot /usr/share/nginx/html/; #错误 html | |
\t} | |
} |
#青龙面板装载路径 | |
/ql/data | |
#博客装载路径(如果你不部署 hexo 博客可以不用配置) | |
/root/.ssh #ssh 证书文件(如果你不用把 hexo 推送到 git 上可以不用配置) | |
/blog #hexo 博客编译目录 | |
/blog/nginx_blog #nginx 上放置博客的目录(例如:/Docker/nginx/html/blog) |
4000端口是hexo-admin使用的,如果你不用可以不配置
ql repo https://github.com/KingRan/KR.git "jd_|jx_|jdCookie" "activity|backUp|wskey" "^jd[^_]|USER|utils|function|sign|sendNotify|ql|JDJR"
0 */3 * * *
名称:JD_COOKIE | |
值:web京东登陆后按F12在网络tab页中的请求内查找cookie,然后复制pt_key=到pt_pin=等 |
repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可 | |
RepoFileExtensions=\"js py ts\" | |
钉钉(消息推送) | |
export DD_BOT_TOKEN= | |
export DD_BOT_SECRET= | |
## 开卡 | |
export guaopencard_All=\"true\" | |
export guaopencard_addSku_All=\"true\" | |
export guaopencardRun_All=\"true\" | |
export guaopencard_draw=\"true\" | |
export JD_TRY=\"true\" | |
export exjxbeans=\"true\" | |
export DY_OPENALL=\"true\" | |
#抽奖 | |
export opencard_draw=3 | |
#开启脚本依赖文件缺失修复 | |
export ec_fix_dep=\"true\" | |
#开启脚本依赖文件更新 | |
export ec_re_dep=\"true\" | |
#清空购物车 | |
export JD_CART_REMOVE=\"true\" | |
export JD_CART=\"true\" | |
#去掉多余的双十一红包脚本 | |
export FLCODE='' | |
#加购物车抽奖 | |
export RUN_CAR=true | |
#停用小额免密支付 | |
export JD_PAY_CONTRACT=true |
#nodejs 依赖 | |
crypto-js\t | |
prettytable\t | |
dotenv\t | |
jsdom\t | |
date-fns\t | |
tough-cookie\t | |
tslib\t | |
ws@7.4.3\t | |
ts-md5\t | |
jsdom -g\t | |
jieba\t | |
fs\t | |
form-data\t | |
json5\t | |
global-agent\t | |
png-js\t | |
@types/node\t | |
require\t | |
typescript\t | |
js-base64\t | |
axios | |
#pythone 依赖 | |
requests\t | |
canvas\t | |
ping3\t | |
jieba\t | |
aiohttp\t | |
PyExecJS | |
#Linux 依赖 | |
bizCode | |
bizMsg | |
lxml |
#配置国内源 | |
pip config --global set global.index-url https://mirrors.aliyun.com/pypi/simple/ | |
pip config --global set install.trusted-host https://mirrors.aliyun.com | |
#升级 pip | |
pip install --upgrade pip | |
#更新青龙 | |
ql update | |
#已知要安装的依赖(不安装部分脚本任务会失败) | |
pnpm install ds | |
#一键安装所有依赖(基于 Faker 一键脚本安装的青龙 | |
可通过执行/ql/data/scripts下的QLDependency.sh脚本安装,如脚本已经更新则通过下面命令执行 | |
curl -fsSL https://git.metauniverse-cn.com/https://raw.githubusercontent.com/shufflewzc/QLDependency/main/Shell/QLOneKeyDependency.sh | sh | |
#一般出现这种错误:(缺依赖) | |
Error: Cannot find module 'xx' | |
执行pnpm install xxx | |
#一般出现这种错误:(缺文件) | |
Error: Cannot find module './xx' | |
那就是拉库命令不完整,请检查或复制完整的拉库命 | |
#Python3 依赖安装失败修复(基于 Faker 一键脚本安装的青龙) | |
curl -sS https://bootstrap.pypa.io/get-pip.py | python3 |
valine: | |
appId: 粘贴5中获取的App ID #Your_appId | |
appKey: 粘贴5中获取的App Key #Your_appkey | |
placeholder: ヽ(○´∀`)ノ♪欢迎畅所欲言 # Comment box placeholder | |
avatar: mp #默认头像设置 Gravatar style : mp, identicon, monsterid, wavatar, robohash, retro | |
pageSize: 10 # Pagination size | |
lang: zh-CN | |
visitor: true # Article reading statistic 这个要设置为 false,以免与 leancloud_visitors 突冲 | |
NoRecordIP: false # Whether to record the commenter IP | |
serverURLs: # When the custom domain name is enabled, fill it in here (it will be detected automatically by default, no need to fill in) | |
powerMode: true | |
tagMeta: | |
visitor: 新朋友 | |
master: 博主 | |
friend: 小伙伴 | |
investor: 金主粑粑 | |
tagColor: | |
master: \"var(--color-orange)\" | |
friend: \"var(--color-aqua)\" | |
investor: \"var(--color-pink)\" | |
tagMember: | |
master: | |
# - hash of master@email.com | |
# - hash of master2@email.com | |
friend: | |
# - hash of friend@email.com | |
# - hash of friend2@email.com | |
investor: | |
# - hash of investor1@email.com |
按本文设置内网连接信息为:
\nip:极空间内网 ip
\n 端口:3306
\n 用户名:root
\n 密码:MYSQL_ROOT_PASSWORD 对应的值
stream { | |
\t | |
\t#极空间 - docker-mariadb | |
\tupstream mariadb { | |
\t\thash $remote_addr consistent; | |
\t\tserver 192.168.0.254:3306; #192.168.0.254 为极空间内网 ip | |
\t} | |
\tserver { | |
\t\tlisten 8090; #8090 为 nginx 监听端口,需要在路由器开放 8090 端口并映射给极空间内网 IP(nginx 部署在极空间上) | |
\t\tproxy_connect_timeout 30s; | |
\t\tproxy_timeout 300s; | |
\t\tproxy_pass mariadb; | |
\t} | |
} |
if((!empty( $_SERVER['HTTP_X_FORWARDED_HOST'])) || (!empty( $_SERVER['HTTP_X_FORWARDED_FOR'])) ) { | |
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST']; | |
$_SERVER['HTTPS'] = 'on'; | |
} |
define('WP_TEMP_DIR', ABSPATH.'wp-content/tmp'); | |
define('FS_METHOD', 'direct'); | |
define('FS_CHMOD_DIR', 0777); | |
define('FS_CHMOD_FILE', 0777); |
chown('/var/www/html', 'www-data'); | |
chgrp('/var/www/html', 'www-data'); | |
chmod('/var/www/html/wp-content/plugins', 0777); | |
chmod('/var/www/html/wp-content/themes', 0777); | |
chmod('/var/www/html/wp-content/tmp', 0777); |
if($_GET['key'] != 'value') { | |
\theader('Location: https://www.xxx.com/'); | |
} |