diff --git a/2022/09/14/Hexo安装摸索/index.html b/2022/09/14/Hexo安装摸索/index.html index 498e4c0ca..04a5182f7 100644 --- a/2022/09/14/Hexo安装摸索/index.html +++ b/2022/09/14/Hexo安装摸索/index.html @@ -1,4 +1,4 @@ -Hexo 安装摸索 - Hexo - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# hexo 博客安装

  1. 安装 nodejs

  2. 安装 git

  3. 安装 hexo(windows 需进入 git bash)

    npm install -g hexo-cli

  4. 初始化博客目录

    hexo init blog

  5. 进入博客目录

    cd blog

  6. 初始化 hexo 到博客目录

    npm install

# shoka 主题安装

  1. 下载主题

    git clone https://github.com/amehime/hexo-theme-shoka.git ./themes/shoka

  2. 卸载 hexo-renderer-marked 以及别的 markdown 文件渲染器

    npm un hexo-renderer-marked --save

  3. 安装(md 文件渲染器,压缩 css/js/html)

    npm i hexo-renderer-multi-markdown-it --save

  4. 安装(给生成的 css 文件们添加浏览器前缀)

    npm i hexo-autoprefixer --save

  5. 安装(站内搜索功能)

    npm i hexo-algoliasearch --save

  6. 安装(文章或站点字数及阅读时间统计)

    npm i hexo-symbols-count-time --save

  7. 安装(生成 Feed 文件)

    npm i hexo-feed --save

# Hexo 部分常用命令

  • 清除静态文件

    hexo clean

  • 生成静态文件

    hexo g

  • 安装 git 推送插件

    npm install hexo-deployer-git --save

  • 推送静态文件到 git

    hexo d

# 安装 hexo-admin(编写博客插件)

admin:
+Hexo 安装摸索 - Hexo - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# hexo 博客安装

  1. 安装 nodejs

  2. 安装 git

  3. 安装 hexo(windows 需进入 git bash)

    npm install -g hexo-cli

  4. 初始化博客目录

    hexo init blog

  5. 进入博客目录

    cd blog

  6. 初始化 hexo 到博客目录

    npm install

# shoka 主题安装

  1. 下载主题

    git clone https://github.com/amehime/hexo-theme-shoka.git ./themes/shoka

  2. 卸载 hexo-renderer-marked 以及别的 markdown 文件渲染器

    npm un hexo-renderer-marked --save

  3. 安装(md 文件渲染器,压缩 css/js/html)

    npm i hexo-renderer-multi-markdown-it --save

  4. 安装(给生成的 css 文件们添加浏览器前缀)

    npm i hexo-autoprefixer --save

  5. 安装(站内搜索功能)

    npm i hexo-algoliasearch --save

  6. 安装(文章或站点字数及阅读时间统计)

    npm i hexo-symbols-count-time --save

  7. 安装(生成 Feed 文件)

    npm i hexo-feed --save

# Hexo 部分常用命令

  • 清除静态文件

    hexo clean

  • 生成静态文件

    hexo g

  • 安装 git 推送插件

    npm install hexo-deployer-git --save

  • 推送静态文件到 git

    hexo d

# 安装 hexo-admin(编写博客插件)

admin:
 username: username
 password_hash: xxxxxx
 secret: 'my super secret phrase' #用单引号包裹
@@ -12,4 +12,4 @@ hexo d
 cd D:\blog
 d:
 @cmd /c "hexo clean&& hexo g&&hexo d&&echo success"
-
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/2022/09/16/极空间chevereto图床docker版安装/index.html b/2022/09/16/极空间chevereto图床docker版安装/index.html index 5516cdeb9..ee7cde753 100644 --- a/2022/09/16/极空间chevereto图床docker版安装/index.html +++ b/2022/09/16/极空间chevereto图床docker版安装/index.html @@ -1 +1 @@ -极空间 chevereto 图床 docker 版安装 - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 安装准备

  1. 需要先安装好 mysql 数据库

  2. 选择版本,1.5 版以前支持中文,之后被维护的团队删除只支持英文

  3. 本文介绍使用的是 linuxserver_chevereto 的镜像

  4. 需要预先创建好给 chevereto 使用的库、账户、密码

  • 经过测试,使用 surenkid_chevereto 的镜像可以完美支持多国语言,配置同 linuxserver_chevereto 一样


# 容器配置

  1. 映射路径(不要放在高速盘,否则会有权限问题)
    6150d69d9a170d96e66ca69420f8c4e8.png

  2. 端口
    08eafb3b30a7eb9b0c0be26ea7a1502a.png

  3. 环境(puid 和 pgid 使用 1000,不要使用 0,否则会报错)
    01567ca9f31f87f832276be35cc4554b.png

# 初始化配置

  1. 使用 http:// 极空间 ip:81 (端口号使用上面配置的,我配置的是 81) 进行 web 访问(数据库配置)
    0.png

  2. 管理员配置(注意 website 配置选择个人,除非需要提供给其它人注册)
    1.png
    2.png

  3. 默认上传大小是 2M,可通过修改 php.ini 配置提升(路径 /etc/php7/php.ini 查找 upload_max_filesize 和 post_max_size 进行修改)。之后用管理员登录通过页面 http://xxx/dashboard/settings/image-upload 修改。
    upload_max_filesize = 256M
    post_max_size = 256M
    max_execution_time = 300
    max_input_time = 300
    memory_limit = 1024M

# 安装完成

  1. 作为图片管理和链接分享服务完全够用。图片链接 url 支持的也很全面。
    2022-09-16-14-52-29.png
    2022-09-16-14-54-58.png
    2022-09-16-14-56-13.png
\ No newline at end of file +极空间 chevereto 图床 docker 版安装 - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 安装准备

  1. 需要先安装好 mysql 数据库

  2. 选择版本,1.5 版以前支持中文,之后被维护的团队删除只支持英文

  3. 本文介绍使用的是 linuxserver_chevereto 的镜像

  4. 需要预先创建好给 chevereto 使用的库、账户、密码

  • 经过测试,使用 surenkid_chevereto 的镜像可以完美支持多国语言,配置同 linuxserver_chevereto 一样


# 容器配置

  1. 映射路径(不要放在高速盘,否则会有权限问题)
    6150d69d9a170d96e66ca69420f8c4e8.png

  2. 端口
    08eafb3b30a7eb9b0c0be26ea7a1502a.png

  3. 环境(puid 和 pgid 使用 1000,不要使用 0,否则会报错)
    01567ca9f31f87f832276be35cc4554b.png

# 初始化配置

  1. 使用 http:// 极空间 ip:81 (端口号使用上面配置的,我配置的是 81) 进行 web 访问(数据库配置)
    0.png

  2. 管理员配置(注意 website 配置选择个人,除非需要提供给其它人注册)
    1.png
    2.png

  3. 默认上传大小是 2M,可通过修改 php.ini 配置提升(路径 /etc/php7/php.ini 查找 upload_max_filesize 和 post_max_size 进行修改)。之后用管理员登录通过页面 http://xxx/dashboard/settings/image-upload 修改。
    upload_max_filesize = 256M
    post_max_size = 256M
    max_execution_time = 300
    max_input_time = 300
    memory_limit = 1024M

# 安装完成

  1. 作为图片管理和链接分享服务完全够用。图片链接 url 支持的也很全面。
    2022-09-16-14-52-29.png
    2022-09-16-14-54-58.png
    2022-09-16-14-56-13.png
\ No newline at end of file diff --git a/2022/09/17/Hexo-Theme-Shoka-algolia搜索踩坑/index.html b/2022/09/17/Hexo-Theme-Shoka-algolia搜索踩坑/index.html index 96f752b8b..a42840bf1 100644 --- a/2022/09/17/Hexo-Theme-Shoka-algolia搜索踩坑/index.html +++ b/2022/09/17/Hexo-Theme-Shoka-algolia搜索踩坑/index.html @@ -1,4 +1,4 @@ -Hexo + Theme.Shoka + algolia 搜索踩坑 - Hexo - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# Hexo + Theme.Shoka 安装

安装介绍

# algolia 注册

  1. algolia 不支持国内邮箱注册,而 google 和 github 由于国内被墙也没法使用。所以只能先注册 netlify 然后通过 netlify 注册 algolia。

  2. 登录 algolia 后创建一个 index,名字随意记住既可。

    2022-09-17-23-32-20.png

  3. 点击右上角红点,弹出窗口点 settings 按钮。

    2022-09-17-23-35-04.png

  4. 点击 API KEYS,获取 appId 和 adminApiKey 填入 hexo 的_config.yml 中 apiKey 暂时不填。

algolia:
+Hexo + Theme.Shoka + algolia 搜索踩坑 - Hexo - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# Hexo + Theme.Shoka 安装

安装介绍

# algolia 注册

  1. algolia 不支持国内邮箱注册,而 google 和 github 由于国内被墙也没法使用。所以只能先注册 netlify 然后通过 netlify 注册 algolia。

  2. 登录 algolia 后创建一个 index,名字随意记住既可。

    2022-09-17-23-32-20.png

  3. 点击右上角红点,弹出窗口点 settings 按钮。

    2022-09-17-23-35-04.png

  4. 点击 API KEYS,获取 appId 和 adminApiKey 填入 hexo 的_config.yml 中 apiKey 暂时不填。

algolia:
   appId: #Your appId
   apiKey: #Your apiKey
   adminApiKey: #Your adminApiKey
@@ -12,4 +12,4 @@
     - gallery
     - photos
     - tags
-
  1. 点击 All Api Keys - New Api key 创建一个 api key,Indices 选先前让记住的 index,ACL 选下面图片中的选项。

    2022-09-17-23-47-50.png

  2. 把第 5 步中新建的 api key 填入到第 4 步中的配置中,到此已经完成了百分之九十,只需要重新编译发布即可。不过编译步骤多了一步,在 hexo g 后需要再执行 hexo algolia,至此搜索功能就大功告成了。

\ No newline at end of file +
  1. 点击 All Api Keys - New Api key 创建一个 api key,Indices 选先前让记住的 index,ACL 选下面图片中的选项。

    2022-09-17-23-47-50.png

  2. 把第 5 步中新建的 api key 填入到第 4 步中的配置中,到此已经完成了百分之九十,只需要重新编译发布即可。不过编译步骤多了一步,在 hexo g 后需要再执行 hexo algolia,至此搜索功能就大功告成了。

\ No newline at end of file diff --git a/2022/09/21/记一次netty-socket-io服务端连接不上的问题/index.html b/2022/09/21/记一次netty-socket-io服务端连接不上的问题/index.html index 21c10373c..ef18e200a 100644 --- a/2022/09/21/记一次netty-socket-io服务端连接不上的问题/index.html +++ b/2022/09/21/记一次netty-socket-io服务端连接不上的问题/index.html @@ -1 +1 @@ -记一次 netty-socketio 服务端连接不上的问题 - 心得体会 - 生活 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

今天前端开发跟我反馈用 vue 的 socketio 连接不上后台服务,连接无反应无任何报错。所以不清楚是前端代码问题还是后台服务的问题。由于框架为另一同事搭建,我只负责处理后端业务逻辑部分,所以第一时间我也不清楚具体的原因。于是我找了个第三方的 socket 工具尝试连接,果然有问题。但是只是提示连接不上,无明显错误原因。到后台查看发现有提示 Unknown transport for request 错误,最后通过调试发现 netty-socketio 的库中 AuthorizeHandler 类有段处理 transport 的代码只能接受大写的 WEBSOCKET 或者 POLLING,于是我在工具中按要求填上结果还是不行。然后我在网上搜索也未发现有相关问题,只发现有网友提示需要用 socketio 的库,不要自己写 socket 连接。于是我找了 socket.io.js 来连接,结果还是一样。经过大量调试改代码,最后突发奇想,有没有可能跟 netty-socketio 的版本有关系,于是我把版本从 1.7.20 升级到 1.7.21,结果就奇迹般的好了。

# 总结:就好像大力出奇迹,实在找不到原因的时候不妨升级一下版本,说不定问题就解决了呢!O (∩_∩) O
\ No newline at end of file +记一次 netty-socketio 服务端连接不上的问题 - 心得体会 - 生活 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

今天前端开发跟我反馈用 vue 的 socketio 连接不上后台服务,连接无反应无任何报错。所以不清楚是前端代码问题还是后台服务的问题。由于框架为另一同事搭建,我只负责处理后端业务逻辑部分,所以第一时间我也不清楚具体的原因。于是我找了个第三方的 socket 工具尝试连接,果然有问题。但是只是提示连接不上,无明显错误原因。到后台查看发现有提示 Unknown transport for request 错误,最后通过调试发现 netty-socketio 的库中 AuthorizeHandler 类有段处理 transport 的代码只能接受大写的 WEBSOCKET 或者 POLLING,于是我在工具中按要求填上结果还是不行。然后我在网上搜索也未发现有相关问题,只发现有网友提示需要用 socketio 的库,不要自己写 socket 连接。于是我找了 socket.io.js 来连接,结果还是一样。经过大量调试改代码,最后突发奇想,有没有可能跟 netty-socketio 的版本有关系,于是我把版本从 1.7.20 升级到 1.7.21,结果就奇迹般的好了。

# 总结:就好像大力出奇迹,实在找不到原因的时候不妨升级一下版本,说不定问题就解决了呢!O (∩_∩) O
\ No newline at end of file diff --git a/2022/09/22/protobuf生成js文件/index.html b/2022/09/22/protobuf生成js文件/index.html index 5b31ef39c..117c01e91 100644 --- a/2022/09/22/protobuf生成js文件/index.html +++ b/2022/09/22/protobuf生成js文件/index.html @@ -1 +1 @@ -protobuf 生成 js 文件 - 工具 - Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 下载工具

protoc-3.19.5-win64.zip

# 生成 js 文件

  1. 把 xxx.proto 文件拷贝到解压的 protoc-3.19.5-win64\bin 目录下

  2. cmd 到相同的 bin 目录下

  3. 执行 protoc.exe --js_out=import_style=commonjs,binary:. ./xxx.proto 命令,就会在 bin 目录下生成 xxx_pb.js 文件

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +protobuf 生成 js 文件 - 工具 - Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 下载工具

protoc-3.19.5-win64.zip

# 生成 js 文件

  1. 把 xxx.proto 文件拷贝到解压的 protoc-3.19.5-win64\bin 目录下

  2. cmd 到相同的 bin 目录下

  3. 执行 protoc.exe --js_out=import_style=commonjs,binary:. ./xxx.proto 命令,就会在 bin 目录下生成 xxx_pb.js 文件

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/2022/09/23/解决域名ip变动后需要重启nginx的问题/index.html b/2022/09/23/解决域名ip变动后需要重启nginx的问题/index.html index 87bef71fb..0acd2a9a8 100644 --- a/2022/09/23/解决域名ip变动后需要重启nginx的问题/index.html +++ b/2022/09/23/解决域名ip变动后需要重启nginx的问题/index.html @@ -1,8 +1,8 @@ -解决域名 ip 变动后需要重启 nginx 的问题 - Nginx - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

今天突然发现自己的网站不能访问了。经过一顿排查,发现是家里的外网 ip 变动后 nginx 解析的域名 ip 还是旧 ip 导致的。手动重启 nginx 后恢复正常。但这不是长久之计,如果每次 ip 变动都需要重启一次 nginx,想想都头大。于是查询资料后获得了解决办法,方法如下:

location / {	
+解决域名 ip 变动后需要重启 nginx 的问题 - Nginx - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

今天突然发现自己的网站不能访问了。经过一顿排查,发现是家里的外网 ip 变动后 nginx 解析的域名 ip 还是旧 ip 导致的。手动重启 nginx 后恢复正常。但这不是长久之计,如果每次 ip 变动都需要重启一次 nginx,想想都头大。于是查询资料后获得了解决办法,方法如下:

location / {	
 	resolver 114.114.114.114 valid=60s; #自定义缓存有效时间间隔对变量中的域名进行解析
 
 	set $my_server "https://ip:port";
 
 	proxy_pass $my_server;
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/2022/09/26/解决Hexo-Shoka背景音乐无法播放的问题/index.html b/2022/09/26/解决Hexo-Shoka背景音乐无法播放的问题/index.html index d6db07a0c..580fb3848 100644 --- a/2022/09/26/解决Hexo-Shoka背景音乐无法播放的问题/index.html +++ b/2022/09/26/解决Hexo-Shoka背景音乐无法播放的问题/index.html @@ -1 +1 @@ -解决 Hexo+Shoka 背景音乐无法播放的问题 - Hexo - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

今天突然发现博客的音乐无法播放了。经过一顿查找,发现是因为 https://api.i-meto.com/meting/api 调用出错了。shoka 主题应该是通过这个网站提取音乐地址、图片等信息。通过断点发现网易播放列表还是能正常获取的,只是列表中的具体音乐、图片无法获取了。于是自己用获取的列表信息组装出正确的 url 问题基本解决。只针对网易播放列表,图片只能使用一张固定的。

解决方法如下:

到 themes\shoka\source\js_app 目录下打开 player.js 文件,在最底部 init (config) 下加入 vendorJs ('fancybox');,然后找到 56 行用下面的代码替换即可。

fetch: function(source) {
      var list = []
      return new Promise(function(resolve, reject) {
        source.forEach(function(raw) {
          var meta = utils.parse(raw)
          if(meta[0]) {
            var skey = JSON.stringify(meta)
            var playlist = store.get(skey)
            if(playlist) {
			  // 自己修改 - start
			  var audioInfos = JSON.parse(playlist);
			  var neteaseStartUrl = "https://music.163.com/song/media/outer/url?id=";
			  if (meta[0] == "netease" && audioInfos && audioInfos.length>0 && !audioInfos[0].url.startsWith(neteaseStartUrl)) {// 如果是网易音乐就自己构建 url
				  jQuery.ajax({
					  url: audioInfos[0].url,
					  type: 'get',
					  async: false,
					  timeout: 5000,
					  complete : function(XMLHttpRequest, status){
						  if (XMLHttpRequest.status != 200) {
							  audioInfos.forEach(function(audioInfo) {
								  var id = audioInfo.url.substring(audioInfo.url.indexOf("id=")+3, audioInfo.url.indexOf("&auth="));
								  audioInfo.url = neteaseStartUrl + id;
								  audioInfo.pic = "https://p3.music.126.net/Vji3PQJAZ2C7gS_6X51NFQ==/109951164723650033.jpg?param=200y200";
							  })
						  }
						  list.push.apply(list, audioInfos);
						  resolve(list);
					  }
				  });
			  } else {
				  list.push.apply(list, audioInfos);
				  resolve(list);
			  }
			  // 自己修改 - end
            } else {
              fetch('https://api.i-meto.com/meting/api?server='+meta[0]+'&type='+meta[1]+'&id='+meta[2]+'&r='+ Math.random())
                .then(function(response) {
                  return response.json()
                }).then(function(json) {
                  store.set(skey, JSON.stringify(json))
                  list.push.apply(list, json);
                  resolve(list);
                }).catch(function(ex) {})
            }
          } else {
            list.push(raw);
            resolve(list);
          }
        })
      })
    }
\ No newline at end of file +解决 Hexo+Shoka 背景音乐无法播放的问题 - Hexo - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

今天突然发现博客的音乐无法播放了。经过一顿查找,发现是因为 https://api.i-meto.com/meting/api 调用出错了。shoka 主题应该是通过这个网站提取音乐地址、图片等信息。通过断点发现网易播放列表还是能正常获取的,只是列表中的具体音乐、图片无法获取了。于是自己用获取的列表信息组装出正确的 url 问题基本解决。只针对网易播放列表,图片只能使用一张固定的。

解决方法如下:

到 themes\shoka\source\js_app 目录下打开 player.js 文件,在最底部 init (config) 下加入 vendorJs ('fancybox');,然后找到 56 行用下面的代码替换即可。

fetch: function(source) {
      var list = []
      return new Promise(function(resolve, reject) {
        source.forEach(function(raw) {
          var meta = utils.parse(raw)
          if(meta[0]) {
            var skey = JSON.stringify(meta)
            var playlist = store.get(skey)
            if(playlist) {
			  // 自己修改 - start
			  var audioInfos = JSON.parse(playlist);
			  var neteaseStartUrl = "https://music.163.com/song/media/outer/url?id=";
			  if (meta[0] == "netease" && audioInfos && audioInfos.length>0 && !audioInfos[0].url.startsWith(neteaseStartUrl)) {// 如果是网易音乐就自己构建 url
				  jQuery.ajax({
					  url: audioInfos[0].url,
					  type: 'get',
					  async: false,
					  timeout: 5000,
					  complete : function(XMLHttpRequest, status){
						  if (XMLHttpRequest.status != 200) {
							  audioInfos.forEach(function(audioInfo) {
								  var id = audioInfo.url.substring(audioInfo.url.indexOf("id=")+3, audioInfo.url.indexOf("&auth="));
								  audioInfo.url = neteaseStartUrl + id;
								  audioInfo.pic = "https://p3.music.126.net/Vji3PQJAZ2C7gS_6X51NFQ==/109951164723650033.jpg?param=200y200";
							  })
						  }
						  list.push.apply(list, audioInfos);
						  resolve(list);
					  }
				  });
			  } else {
				  list.push.apply(list, audioInfos);
				  resolve(list);
			  }
			  // 自己修改 - end
            } else {
              fetch('https://api.i-meto.com/meting/api?server='+meta[0]+'&type='+meta[1]+'&id='+meta[2]+'&r='+ Math.random())
                .then(function(response) {
                  return response.json()
                }).then(function(json) {
                  store.set(skey, JSON.stringify(json))
                  list.push.apply(list, json);
                  resolve(list);
                }).catch(function(ex) {})
            }
          } else {
            list.push(raw);
            resolve(list);
          }
        })
      })
    }
\ No newline at end of file diff --git a/2022/09/27/nginx负载均衡配置/index.html b/2022/09/27/nginx负载均衡配置/index.html index 2376aed9e..97619a2ca 100644 --- a/2022/09/27/nginx负载均衡配置/index.html +++ b/2022/09/27/nginx负载均衡配置/index.html @@ -1,4 +1,4 @@ -nginx 负载均衡配置 - Nginx - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# nginx 负载均衡配置

  1. 轮询(默认)

每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。

upstream my_server {
+nginx 负载均衡配置 - Nginx - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# nginx 负载均衡配置

  1. 轮询(默认)

每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。

upstream my_server {
 	server 192.168.0.2:8080;
 	server 192.168.0.3:8080;
 }
@@ -13,7 +13,7 @@ server {
 	}
 	
 }
-
  1. weight 权重策略

weight 代表权重,默认为 1,权重越高被分配的客户端越多,指定轮询几率。weight 和访问比率成正比,用于后端服务器性能不均的情况。

upstream my_server {
+
  1. weight 权重策略

weight 代表权重,默认为 1,权重越高被分配的客户端越多,指定轮询几率。weight 和访问比率成正比,用于后端服务器性能不均的情况。

upstream my_server {
 	server 192.168.0.2:8080 weight=1;
 	server 192.168.0.3:8080 weight=2;
 }
@@ -28,7 +28,7 @@ server {
 	}
 	
 }
-
  1. ip_hash

每个请求按访问 ip 的 hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决 session 的问题。

upstream my_server {
+
  1. ip_hash

每个请求按访问 ip 的 hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决 session 的问题。

upstream my_server {
 	ip_hash;
 	server 192.168.0.2:8080;
 	server 192.168.0.3:8080;
@@ -44,7 +44,7 @@ server {
 	}
 	
 }
-
  1. fair (第三方)

按后端服务器的响应时间来分配请求,响应时间短的优先分配。

upstream my_server {
+
  1. fair (第三方)

按后端服务器的响应时间来分配请求,响应时间短的优先分配。

upstream my_server {
 	server 192.168.0.2:8080;
 	server 192.168.0.3:8080;
 	fair;
@@ -60,4 +60,4 @@ server {
 	}
 	
 }
-
  1. 动静分离

把静态的资源,比如图片,css,js 等先加载到 Nginx 的服务器里。

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +
  1. 动静分离

把静态的资源,比如图片,css,js 等先加载到 Nginx 的服务器里。

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/2022/09/28/深深的挫败和无助感/index.html b/2022/09/28/深深的挫败和无助感/index.html index 822a60aef..c6d8271ea 100644 --- a/2022/09/28/深深的挫败和无助感/index.html +++ b/2022/09/28/深深的挫败和无助感/index.html @@ -1 +1 @@ -深深的挫败和无助感 - 心情 - 生活 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +深深的挫败和无助感 - 心情 - 生活 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/2022/10/06/Nginx配置iframe访问/index.html b/2022/10/06/Nginx配置iframe访问/index.html index 7165807e6..4b9d5cf2b 100644 --- a/2022/10/06/Nginx配置iframe访问/index.html +++ b/2022/10/06/Nginx配置iframe访问/index.html @@ -1 +1 @@ -Nginx 配置 iframe 访问 - Nginx - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# X-Frame-Options 响应头配置详解

X-Frame-Options HTTP 响应头是用来给浏览器指示允许一个页面可否在,或者 中展现的标记。网站可以使用此功能,来确保自己网站的内容没有被嵌套到别人的网站中去,也从而避免了点击劫持 (clickjacking) 的攻击。
X-Frame-Options 三个参数:

1、 DENY

表示该页面不允许在 frame 中展示,即便是在相同域名的页面中嵌套也不允许。

2、SAMEORIGIN

表示该页面可以在相同域名页面的 frame 中展示。

3、ALLOW-FROM uri

表示该页面可以在指定来源的 frame 中展示。

4、ALLOWALL

表示该页面可以在任何来源的 frame 中展示。

换一句话说,如果设置为 DENY,不光在别人的网站 frame 嵌入时会无法加载,在同域名页面中同样会无法加载。另一方面,如果设置为 SAMEORIGIN,那么页面就可以在同域名页面的 frame 中嵌套。正常情况下我们通常使用 SAMEORIGIN 参数。

# Apache 配置

需要把下面这行添加到'site' 的配置中

Header always append X-Frame-Options SAMEORIGIN

# Nginx 配置

需要添加到 ‘http’, ‘server’ 或者 ‘location’ 的配置项中,个人来讲喜欢配置在‘server’ 中

正常情况下都是使用 SAMEORIGIN 参数,允许同域嵌套
add_header X-Frame-Options SAMEORIGIN;

允许单个域名 iframe 嵌套
add_header X-Frame-Options ALLOW-FROM http://xxx.com/;

允许多个域名 iframe 嵌套,注意这里是用逗号分隔
add_header X-Frame-Options "ALLOW-FROM http://xxx.com/,https://xxx.com/";

允许任何域名 iframe 嵌套
add_header X-Frame-Options ALLOWALL;

# Tomcat 配置

在‘conf/web.xml’填加以下配置

<filter>
        <filter-name>httpHeaderSecurity</filter-name>
        <filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
        <init-param>
            <param-name>antiClickJackingOption</param-name>
            <param-value>SAMEORIGIN</param-value>
        </init-param>
        <async-supported>true</async-supported>
    </filter>
<filter-mapping>
        <filter-name>httpHeaderSecurity</filter-name>
        <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

# IIS 配置

添加下面的配置到 ‘Web.config’文件中

<system.webServer>
  <httpProtocol>
    <customHeaders>
      <add name="X-Frame-Options" value="SAMEORIGIN" />
    </customHeaders>
  </httpProtocol>
</system.webServer>
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +Nginx 配置 iframe 访问 - Nginx - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# X-Frame-Options 响应头配置详解

X-Frame-Options HTTP 响应头是用来给浏览器指示允许一个页面可否在,或者 中展现的标记。网站可以使用此功能,来确保自己网站的内容没有被嵌套到别人的网站中去,也从而避免了点击劫持 (clickjacking) 的攻击。
X-Frame-Options 三个参数:

1、 DENY

表示该页面不允许在 frame 中展示,即便是在相同域名的页面中嵌套也不允许。

2、SAMEORIGIN

表示该页面可以在相同域名页面的 frame 中展示。

3、ALLOW-FROM uri

表示该页面可以在指定来源的 frame 中展示。

4、ALLOWALL

表示该页面可以在任何来源的 frame 中展示。

换一句话说,如果设置为 DENY,不光在别人的网站 frame 嵌入时会无法加载,在同域名页面中同样会无法加载。另一方面,如果设置为 SAMEORIGIN,那么页面就可以在同域名页面的 frame 中嵌套。正常情况下我们通常使用 SAMEORIGIN 参数。

# Apache 配置

需要把下面这行添加到'site' 的配置中

Header always append X-Frame-Options SAMEORIGIN

# Nginx 配置

需要添加到 ‘http’, ‘server’ 或者 ‘location’ 的配置项中,个人来讲喜欢配置在‘server’ 中

正常情况下都是使用 SAMEORIGIN 参数,允许同域嵌套
add_header X-Frame-Options SAMEORIGIN;

允许单个域名 iframe 嵌套
add_header X-Frame-Options ALLOW-FROM http://xxx.com/;

允许多个域名 iframe 嵌套,注意这里是用逗号分隔
add_header X-Frame-Options "ALLOW-FROM http://xxx.com/,https://xxx.com/";

允许任何域名 iframe 嵌套
add_header X-Frame-Options ALLOWALL;

# Tomcat 配置

在‘conf/web.xml’填加以下配置

<filter>
        <filter-name>httpHeaderSecurity</filter-name>
        <filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
        <init-param>
            <param-name>antiClickJackingOption</param-name>
            <param-value>SAMEORIGIN</param-value>
        </init-param>
        <async-supported>true</async-supported>
    </filter>
<filter-mapping>
        <filter-name>httpHeaderSecurity</filter-name>
        <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

# IIS 配置

添加下面的配置到 ‘Web.config’文件中

<system.webServer>
  <httpProtocol>
    <customHeaders>
      <add name="X-Frame-Options" value="SAMEORIGIN" />
    </customHeaders>
  </httpProtocol>
</system.webServer>
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/2022/10/11/svn库转git库/index.html b/2022/10/11/svn库转git库/index.html index 4f0e42548..9aba12a1f 100644 --- a/2022/10/11/svn库转git库/index.html +++ b/2022/10/11/svn库转git库/index.html @@ -1 +1 @@ -svn 库转 git 库 - 工具 - Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 前期准备

首先安装好 svn 和 git 工具。

# svn 转 git

1、 到 svn 项目目录右键选中 gitbash 打开窗口,执行获取用户并映射成 git 样式账号命令如下:
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > users.txt

然后会在目录下生成文件 users.txt 样式如:zhansan = 张三 zhansan@xxx.com

2、新建个文件夹,将生成的 users.txt 放入新建的文件夹,然后在新建的文件夹中右键选中 gitbash 弹出窗口后执行下面命令(https://svn_project_url/ 为 svn 库的 url),拉取 svn 代码到本地新建文件夹中。
git svn clone https://svn_project_url/ --no-metadata --no-minimize-url --authors-file=users.txt

  • 期间可能会弹出 svn 的账户密码验证窗口,正确输入即可。

# 推送项目到 git 库

1、在 gitbash 窗口 cd 到 git 项目文件夹中执行以下命令把 git 仓库地址加入到 remote 中(https://git_project_url/ 为 git 库的 url)。
git remote add origin https://git_project_url/

2、push 项目到 git 库中。
git push origin master

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +svn 库转 git 库 - 工具 - Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 前期准备

首先安装好 svn 和 git 工具。

# svn 转 git

1、 到 svn 项目目录右键选中 gitbash 打开窗口,执行获取用户并映射成 git 样式账号命令如下:
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > users.txt

然后会在目录下生成文件 users.txt 样式如:zhansan = 张三 zhansan@xxx.com

2、新建个文件夹,将生成的 users.txt 放入新建的文件夹,然后在新建的文件夹中右键选中 gitbash 弹出窗口后执行下面命令(https://svn_project_url/ 为 svn 库的 url),拉取 svn 代码到本地新建文件夹中。
git svn clone https://svn_project_url/ --no-metadata --no-minimize-url --authors-file=users.txt

  • 期间可能会弹出 svn 的账户密码验证窗口,正确输入即可。

# 推送项目到 git 库

1、在 gitbash 窗口 cd 到 git 项目文件夹中执行以下命令把 git 仓库地址加入到 remote 中(https://git_project_url/ 为 git 库的 url)。
git remote add origin https://git_project_url/

2、push 项目到 git 库中。
git push origin master

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/2022/10/12/使用picgo上传图片到chevereto/index.html b/2022/10/12/使用picgo上传图片到chevereto/index.html index 0f6ac95b5..1f4fe594c 100644 --- a/2022/10/12/使用picgo上传图片到chevereto/index.html +++ b/2022/10/12/使用picgo上传图片到chevereto/index.html @@ -1 +1 @@ -使用 PicGo 上传图片到 chevereto - 工具 - Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 简介

PicGo 是一款开源的图床管理工具,十分流行。

PicGo 官方指南:PicGo | PicGo

# 配置

  1. 安装插件(需要先安装 NodeJS)

  2. 图床配置
    url 后缀必须用红线圈中的部分,key 在 chevereto 登陆后 api 配置中查找

\ No newline at end of file +使用 PicGo 上传图片到 chevereto - 工具 - Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 简介

PicGo 是一款开源的图床管理工具,十分流行。

PicGo 官方指南:PicGo | PicGo

# 配置

  1. 安装插件(需要先安装 NodeJS)

  2. 图床配置
    url 后缀必须用红线圈中的部分,key 在 chevereto 登陆后 api 配置中查找

\ No newline at end of file diff --git a/2022/10/14/nginx允许跨域获取cookies方法/index.html b/2022/10/14/nginx允许跨域获取cookies方法/index.html index 748a65758..87aede5ef 100644 --- a/2022/10/14/nginx允许跨域获取cookies方法/index.html +++ b/2022/10/14/nginx允许跨域获取cookies方法/index.html @@ -1,4 +1,4 @@ -nginx 允许跨域获取 cookie 的方法 - Nginx - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 使用场景

在 A 域名的页面向 B 域名提交数据时需要代入 B 域名的 cookie,否则 B 域名会跳转到登陆页面。解决方式需要使用到 nginx 反向代理,配置如下:

server {
+nginx 允许跨域获取 cookie 的方法 - Nginx - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 使用场景

在 A 域名的页面向 B 域名提交数据时需要代入 B 域名的 cookie,否则 B 域名会跳转到登陆页面。解决方式需要使用到 nginx 反向代理,配置如下:

server {
 	listen port ssl http2;
 	server_name xxx.com;
 	ssl_certificate_key /xxx.key;
@@ -11,4 +11,4 @@
 		proxy_pass http://xxx;
 	}
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/2022/10/17/redis主从基础配置记录/index.html b/2022/10/17/redis主从基础配置记录/index.html index c4f9b71c3..976ddf0a7 100644 --- a/2022/10/17/redis主从基础配置记录/index.html +++ b/2022/10/17/redis主从基础配置记录/index.html @@ -1,4 +1,4 @@ -redis 主从基础配置 - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 主服务

  1. 基础配置
port 6379
+redis 主从基础配置 - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 主服务

  1. 基础配置
port 6379
 requirepass 123456(密码,建议不设置)
 vm-enabled no (虚拟内存,内存够的情况下可以不使用)
 maxmemory 1GB(告诉Redis当使用了多少物理内存后就开始拒绝后续的写入)
@@ -13,7 +13,7 @@ echo never > /sys/kernel/mm/transparent_hugepage/enabled
 修改/etc/init.d/redis-server,加入/bin/echo never > /sys/kernel/mm/transparent_hugepage/enabled
 
  1. 修复 TCP 警告
sysctl net.core.somaxconn=1024(立即生效)
 修改/etc/sysctl.conf添加net.core.somaxconn=1024
-
  1. 客户端缓冲区限制
客户端的输出缓冲区的限制,因为某种原因客户端从服务器读取数据的速度不够快,可用于强制断开连接(一个常见的原因是一个发布 / 订阅客户端消费消息的速度无法赶上生产它们的速度)。
+
  1. 客户端缓冲区限制
客户端的输出缓冲区的限制,因为某种原因客户端从服务器读取数据的速度不够快,可用于强制断开连接(一个常见的原因是一个发布 / 订阅客户端消费消息的速度无法赶上生产它们的速度)。
 可以三种不同客户端的方式进行设置:
 normal ->  正常客户端
 slave  -> slave 和 MONITOR 客户端
@@ -27,7 +27,7 @@ client-output-buffer-limit <class><hard limit> <soft limit> &l
 client-output-buffer-limit normal 0 0 0
 client-output-buffer-limit slave 5gb 512mb 60
 client-output-buffer-limit pubsub 32mb 8mb 60
-
  1. 持久化配置
---关闭RDB持久化---
+
  1. 持久化配置
---关闭RDB持久化---
 save ""
 默认配置如下:
 save 900 1 #900秒内有1次更新就持久化
@@ -50,7 +50,7 @@ repl-backlog-ttl 3600 如果一段时间后没有slave连接到master,则backl
 slave-priority 100 slave端的优先级设置,值是一个整数,数字越小表示优先级越高。当master故障时将会按照优先级来选择slave端进行恢复,如果值设置为0,则表示该slave永远不会被选择。
 min-slaves-to-write 3
 min-slaves-max-lag 10 设置当一个master端的可用slave少于N个,延迟时间大于M秒时,不接收写操作。
-

# 从服务

基本配置同主服务一致
+

# 从服务

基本配置同主服务一致
 slaveof 127.0.0.1 6379(主redis的ip和端口)
 masterauth 123456 (主redis的密码)
 可以通过slaveof no one命令将Slaver升级为Maste
@@ -74,4 +74,4 @@ redis-cli config set stop-writes-on-bgsave-error no
 sudo vim /etc/redis/redis.conf把stop-writes-on-bgsave-error改为no
 修改系统 sudo vim /etc/sysctl.conf加入vm.overcommit_memory=1
 sudo sysctl vm.overcommit_memory=1
-
\ No newline at end of file +
\ No newline at end of file diff --git a/2022/10/18/搭建nagios监控/index.html b/2022/10/18/搭建nagios监控/index.html index a492f2004..ae86fa08b 100644 --- a/2022/10/18/搭建nagios监控/index.html +++ b/2022/10/18/搭建nagios监控/index.html @@ -1,4 +1,4 @@ -搭建 nagios 监控 - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 监控端服务安装与配置

  1. nagios 需要安装主程序 core 和 nrpe(nagios 和各被监控主机都必须安装)。如需使用自研前端可通过安装 ndoutils (用于把 nagios 监控信息写入数据库) 和 mysql 实现。具体安装见官网
  2. nagios 默认监控命令脚本放置在 libexec 中,自定义脚本也放到此处
  3. etc/objects/commands.cfg 用于保存 nagios 默认监控命令
  4. etc/nrpe.cfg 文件中需要添加用于被监控执行命令项(各被监控主机中都需要添加)
  5. etc/objects/hosts 目录下配置需要被监控的主机信息
  6. etc/objects/servers 目录下配置需要在被监控主机上执行的监控命令(第 4 项中的命令)

# 被监控端服务安装与配置

  1. 被监控端需要安装 nrpe
  2. 被监控端需要把监控端的命令写入到 nrpe 的配置文件中
  3. 被监控端需要把命令执行脚本放入 libexec 目录中
  4. 被监控端自动安装脚本(可借鉴)
1、请先修改脚本中的服务端IP。
+搭建 nagios 监控 - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 监控端服务安装与配置

  1. nagios 需要安装主程序 core 和 nrpe(nagios 和各被监控主机都必须安装)。如需使用自研前端可通过安装 ndoutils (用于把 nagios 监控信息写入数据库) 和 mysql 实现。具体安装见官网
  2. nagios 默认监控命令脚本放置在 libexec 中,自定义脚本也放到此处
  3. etc/objects/commands.cfg 用于保存 nagios 默认监控命令
  4. etc/nrpe.cfg 文件中需要添加用于被监控执行命令项(各被监控主机中都需要添加)
  5. etc/objects/hosts 目录下配置需要被监控的主机信息
  6. etc/objects/servers 目录下配置需要在被监控主机上执行的监控命令(第 4 项中的命令)

# 被监控端服务安装与配置

  1. 被监控端需要安装 nrpe
  2. 被监控端需要把监控端的命令写入到 nrpe 的配置文件中
  3. 被监控端需要把命令执行脚本放入 libexec 目录中
  4. 被监控端自动安装脚本(可借鉴)
1、请先修改脚本中的服务端IP。
 2、如被监控端不支持let计算命令请执行sudo dpkg-reconfigure dash命令,弹出选择窗口后选择no。
 3、需要在脚本同目录下创建CentOS、Ubuntu、sh和conf目录,目录下分别放置nrpe的tar安装包、监控脚本和nrpe配置文件。
 
@@ -216,4 +216,4 @@ sudo rm -f /usr/local/nagios/var/ndo2db.pid
 sudo rm -f /usr/local/nagios/var/ndo.sock
 sudo systemctl restart ndo2db.service
 sudo systemctl status ndo2db.service
-
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/2022/10/19/长了一岁/index.html b/2022/10/19/长了一岁/index.html index f6194140e..6fa4734e4 100644 --- a/2022/10/19/长了一岁/index.html +++ b/2022/10/19/长了一岁/index.html @@ -1 +1 @@ -又长了一岁 - 心情 - 生活 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

一年一次的总结时间又到了,这一年前半年平平无奇,后半年惊涛骇浪。中年危机如期而遇,人身的低谷终究还是来了。很沮丧也很无助,但还是要坚强面对。人生起起伏伏,时好时坏,终归还是会好起来的。加油!加油!加油

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +又长了一岁 - 心情 - 生活 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

一年一次的总结时间又到了,这一年前半年平平无奇,后半年惊涛骇浪。中年危机如期而遇,人身的低谷终究还是来了。很沮丧也很无助,但还是要坚强面对。人生起起伏伏,时好时坏,终归还是会好起来的。加油!加油!加油

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/2022/10/20/极空间Docker版Wordpress安装与配置/index.html b/2022/10/20/极空间Docker版Wordpress安装与配置/index.html index 4cba894a0..fa1dc12cf 100644 --- a/2022/10/20/极空间Docker版Wordpress安装与配置/index.html +++ b/2022/10/20/极空间Docker版Wordpress安装与配置/index.html @@ -1,4 +1,4 @@ -极空间 Docker 版 Wordpress 安装与配置 - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 安装

  • 下载最新版 wordpress 镜像,如极空间无法下载,可到 passerma 网站下载。
  • 需要先在 mysql 中创建给 wordpress 使用的库。
  • 文件路径映射(目前极空间不能映射到高速盘,否则无法启动)。
  • 端口映射。
  • 通过映射的端口访问安装界面(一定要通过最终访问的页面进行安装,否则修改配置比较麻烦。如最终是域名访问,就先把域名解析代理等先配置好,再通过域名访问安装)。

# 配置

  • 如需使用 https 访问,需要在 wp-config.php 中加入以下代码,否则资源文件无法访问。
if((!empty( $_SERVER['HTTP_X_FORWARDED_HOST'])) || (!empty( $_SERVER['HTTP_X_FORWARDED_FOR'])) ) {
+极空间 Docker 版 Wordpress 安装与配置 - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 安装

  • 下载最新版 wordpress 镜像,如极空间无法下载,可到 passerma 网站下载。
  • 需要先在 mysql 中创建给 wordpress 使用的库。
  • 文件路径映射(目前极空间不能映射到高速盘,否则无法启动)。
  • 端口映射。
  • 通过映射的端口访问安装界面(一定要通过最终访问的页面进行安装,否则修改配置比较麻烦。如最终是域名访问,就先把域名解析代理等先配置好,再通过域名访问安装)。

# 配置

  • 如需使用 https 访问,需要在 wp-config.php 中加入以下代码,否则资源文件无法访问。
if((!empty( $_SERVER['HTTP_X_FORWARDED_HOST'])) || (!empty( $_SERVER['HTTP_X_FORWARDED_FOR'])) ) {
     $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
     $_SERVER['HTTPS'] = 'on';
 }
@@ -14,4 +14,4 @@ chmod('/var/www/html/wp-content/tmp', 0777);
 
  • 隐藏后台访问需要在 wp-login.php 中加入以下代码,key、value 和 https://www.xxx.com/ 需要修改为自己的。修改后只能通过 https://www.xxx.com/wp-login.php?key=value 访问,其它访问需要登录的页面都会跳转到配置的 https://www.xxx.com/ 地址。
if($_GET['key'] != 'value') {
 	header('Location: https://www.xxx.com/');
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/2022/10/21/Hexo-Theme-Shoka-Valine评论配置/index.html b/2022/10/21/Hexo-Theme-Shoka-Valine评论配置/index.html index e88fa0e02..16bb137c5 100644 --- a/2022/10/21/Hexo-Theme-Shoka-Valine评论配置/index.html +++ b/2022/10/21/Hexo-Theme-Shoka-Valine评论配置/index.html @@ -1,4 +1,4 @@ -Hexo + Theme.Shoka + Valine 评论配置 - Hexo - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
  • valine 评论需要 LeanCloud 支持

# LeanCloud 注册

  1. LeanCloud 网站完成注册。
  2. 创建应用。
  3. 名称随便取,方案看自己选择。开发版免费但是有限制,商业版收费无限制。
  4. 点击配置按钮进行配置。
  5. 点击设置 - 应用凭证可获取 App ID 和 App Key
  6. 点击设置 - 安全中心根据自己的需求配置

# 修改 Theme.Shoka 配置

valine:
+Hexo + Theme.Shoka + Valine 评论配置 - Hexo - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
  • valine 评论需要 LeanCloud 支持

# LeanCloud 注册

  1. LeanCloud 网站完成注册。
  2. 创建应用。
  3. 名称随便取,方案看自己选择。开发版免费但是有限制,商业版收费无限制。
  4. 点击配置按钮进行配置。
  5. 点击设置 - 应用凭证可获取 App ID 和 App Key
  6. 点击设置 - 安全中心根据自己的需求配置

# 修改 Theme.Shoka 配置

valine:
   appId: 粘贴5中获取的App ID #Your_appId
   appKey: 粘贴5中获取的App Key #Your_appkey
   placeholder: ヽ(○´∀`)ノ♪欢迎畅所欲言 # Comment box placeholder
@@ -27,4 +27,4 @@
       # - hash of friend2@email.com
     investor:
       # - hash of investor1@email.com
-
\ No newline at end of file +
\ No newline at end of file diff --git a/2022/10/21/极空间Docker版mariadb安装与配置/index.html b/2022/10/21/极空间Docker版mariadb安装与配置/index.html index 479a2c467..1ea3c6813 100644 --- a/2022/10/21/极空间Docker版mariadb安装与配置/index.html +++ b/2022/10/21/极空间Docker版mariadb安装与配置/index.html @@ -1,4 +1,4 @@ -极空间 Docker 版 mariadb 安装与配置 - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 介绍

  • mariadb 属于 mysql 的一个分支,完全兼容 mysql,使用方式和 mysql 无区别。

# 安装

  • 本文介绍安装的镜像为 linuxserver_mariadb 的 10.5.13-r0-ls45,原则上使用最新版即可
  • 配置文件映射
  • 端口
  • 环境(MYSQL_ROOT_PASSWORD 为数据库 root 用户密码)
  • 到此已经可以在内网使用了,连接方法同 mysql 一致

# 配置

  • 此处配置为 nginx 反向代理,配置完成后可在外网连接访问
stream {
+极空间 Docker 版 mariadb 安装与配置 - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 介绍

  • mariadb 属于 mysql 的一个分支,完全兼容 mysql,使用方式和 mysql 无区别。

# 安装

  • 本文介绍安装的镜像为 linuxserver_mariadb 的 10.5.13-r0-ls45,原则上使用最新版即可
  • 配置文件映射
  • 端口
  • 环境(MYSQL_ROOT_PASSWORD 为数据库 root 用户密码)
  • 到此已经可以在内网使用了,连接方法同 mysql 一致

# 配置

  • 此处配置为 nginx 反向代理,配置完成后可在外网连接访问
stream {
 	
 	#极空间-docker-mariadb
 	upstream mariadb {
@@ -15,4 +15,4 @@
 	}
     
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/2022/10/22/极空间Docker版青龙面板安装与配置/index.html b/2022/10/22/极空间Docker版青龙面板安装与配置/index.html index 37dc59741..9bfeb2893 100644 --- a/2022/10/22/极空间Docker版青龙面板安装与配置/index.html +++ b/2022/10/22/极空间Docker版青龙面板安装与配置/index.html @@ -1,12 +1,12 @@ -极空间 Docker 版青龙面板安装与配置 - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 介绍

  • 青龙面板是一个支持 python3、javascript、shell、typescript 的定时任务管理面板。它支持在线管理脚本、环境变量、配置文件,支持在线查看日志及支持多种方式的消息通知。

# 安装

  • 本文使用的是 whyour/qinglong 的镜像。
  • 路径映射(由于青龙面板有 nodejs 环境,所以我把 hexo 博客的编译也放置在上面,再把 nginx 的 html 映射过来,这样就可以直接编译发布了。)
#青龙面板装载路径
+极空间 Docker 版青龙面板安装与配置 - Docker - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 介绍

  • 青龙面板是一个支持 python3、javascript、shell、typescript 的定时任务管理面板。它支持在线管理脚本、环境变量、配置文件,支持在线查看日志及支持多种方式的消息通知。

# 安装

  • 本文使用的是 whyour/qinglong 的镜像。
  • 路径映射(由于青龙面板有 nodejs 环境,所以我把 hexo 博客的编译也放置在上面,再把 nginx 的 html 映射过来,这样就可以直接编译发布了。)
#青龙面板装载路径
 /ql/data
 #博客装载路径(如果你不部署hexo博客可以不用配置)
 /root/.ssh  #ssh证书文件(如果你不用把hexo推送到git上可以不用配置)
 /blog      #hexo博客编译目录
 /blog/nginx_blog  #nginx上放置博客的目录(例如:/Docker/nginx/html/blog)
-
  • 端口

    4000端口是hexo-admin使用的,如果你不用可以不配置
  • 环境
  • 登录
    地址:http:// 极空间 IP:5700
    默认账号:admin
    默认密码:admin

# 配置

  • 我主要用青龙面板跑京东的脚本,所以也只介绍相关的配置方法
  • 定时任务 (我使用的是 KingRan/KR 的集合库,以下是拉取命令)
    ql repo https://github.com/KingRan/KR.git "jd_|jx_|jdCookie" "activity|backUp|wskey" "^jd[^_]|USER|utils|function|sign|sendNotify|ql|JDJR"
  • 定时规则(我是每 3 小时拉取一次,不要拉取太频繁否则可能被封)
    0 */3 * * *
  • 环境变量
名称:JD_COOKIE
+
  • 端口

    4000端口是hexo-admin使用的,如果你不用可以不配置
  • 环境
  • 登录
    地址:http:// 极空间 IP:5700
    默认账号:admin
    默认密码:admin

# 配置

  • 我主要用青龙面板跑京东的脚本,所以也只介绍相关的配置方法
  • 定时任务 (我使用的是 KingRan/KR 的集合库,以下是拉取命令)
    ql repo https://github.com/KingRan/KR.git "jd_|jx_|jdCookie" "activity|backUp|wskey" "^jd[^_]|USER|utils|function|sign|sendNotify|ql|JDJR"
  • 定时规则(我是每 3 小时拉取一次,不要拉取太频繁否则可能被封)
    0 */3 * * *
  • 环境变量
名称:JD_COOKIE
 值:web京东登陆后按F12在网络tab页中的请求内查找cookie,然后复制pt_key=到pt_pin=等
-
  • 配置文件 (主要修改和添加以下配置)
repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可
+
  • 配置文件 (主要修改和添加以下配置)
repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可
 RepoFileExtensions="js py ts"
 钉钉(消息推送)
 export DD_BOT_TOKEN=
@@ -34,7 +34,7 @@ export FLCODE=''
 export RUN_CAR=true
 #停用小额免密支付
 export JD_PAY_CONTRACT=true
-
  • 依赖管理
#nodejs依赖
+
  • 依赖管理
#nodejs依赖
 crypto-js	
 prettytable	
 dotenv	
@@ -94,4 +94,4 @@ Error: Cannot find module './xx'
 
 #Python3依赖安装失败修复(基于Faker一键脚本安装的青龙)
 curl -sS https://bootstrap.pypa.io/get-pip.py | python3
-
\ No newline at end of file +
\ No newline at end of file diff --git a/2022/10/27/极空间web端https直连nginx配置/index.html b/2022/10/27/极空间web端https直连nginx配置/index.html index 4769a4b91..3f8832596 100644 --- a/2022/10/27/极空间web端https直连nginx配置/index.html +++ b/2022/10/27/极空间web端https直连nginx配置/index.html @@ -1,9 +1,9 @@ -极空间 web 端 https 直连 nginx 配置 - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 介绍

  • ip 直连一般都映射了 5055, 但是直接访问 5055 极空间只提供了 http 协议,如果希望使用 https 协议则必须使用其它端口进行访问。以下方案采用 nginx 反向代理实现,端口使用 10000 举例。

# 配置

  1. 需要先把 10000 端口在路由器上做好映射。
  2. 证书生成好并放置到 nginx 上。(证书生成方法不做介绍请自行百度)
  3. http 跳转 https 配置
server {
+极空间 web 端 https 直连 nginx 配置 - 极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 介绍

  • ip 直连一般都映射了 5055, 但是直接访问 5055 极空间只提供了 http 协议,如果希望使用 https 协议则必须使用其它端口进行访问。以下方案采用 nginx 反向代理实现,端口使用 10000 举例。

# 配置

  1. 需要先把 10000 端口在路由器上做好映射。
  2. 证书生成好并放置到 nginx 上。(证书生成方法不做介绍请自行百度)
  3. http 跳转 https 配置
server {
 		if ($scheme = http) {
 			rewrite ^(.*)$ https://$host$1 permanent;
 		}
 }
-
  1. web 端口监听配置
#极空间-web
+
  1. web 端口监听配置
#极空间-web
 server {
 	listen 10000 ssl http2; #ipv4
 	listen [::]:10000 ssl http2; #ipv6
@@ -67,4 +67,4 @@ server {
 		root /usr/share/nginx/html/; #错误html
 	}
 }
-

# 问题

  • 需要开启允许嵌套否则登陆后所有应用都是拒绝访问
  • 需要配置 proxy_redirect 替换响应 url,否则会跳转到默认 http 协议的 5055 端口
  • 如果配置 proxy_redirect 后无效可能需要清除浏览器缓存(F12 - 网络 - 右键点击 url 区域 - 清除浏览器缓存)
\ No newline at end of file +

# 问题

  • 需要开启允许嵌套否则登陆后所有应用都是拒绝访问
  • 需要配置 proxy_redirect 替换响应 url,否则会跳转到默认 http 协议的 5055 端口
  • 如果配置 proxy_redirect 后无效可能需要清除浏览器缓存(F12 - 网络 - 右键点击 url 区域 - 清除浏览器缓存)
\ No newline at end of file diff --git a/2022/10/31/一键关闭Windows10-11系统自动更新/index.html b/2022/10/31/一键关闭Windows10-11系统自动更新/index.html index 6e761b4d1..54725697a 100644 --- a/2022/10/31/一键关闭Windows10-11系统自动更新/index.html +++ b/2022/10/31/一键关闭Windows10-11系统自动更新/index.html @@ -1 +1 @@ -一键关闭 Windows10/11 系统自动更新 - 工具 - Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 介绍

  • 当你经常需要在家远程到公司进行办公,或者开启了很多临时文件、文档、软件需要等到第二天继续之前的工作时,结果系统自行更新并重启了。是不是会让你非常郁闷。关闭系统自行更新就可以轻松解决此类问题。

# 下载

win10 / win11 / 本地

\ No newline at end of file +一键关闭 Windows10/11 系统自动更新 - 工具 - Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 介绍

  • 当你经常需要在家远程到公司进行办公,或者开启了很多临时文件、文档、软件需要等到第二天继续之前的工作时,结果系统自行更新并重启了。是不是会让你非常郁闷。关闭系统自行更新就可以轻松解决此类问题。

# 下载

win10 / win11 / 本地

\ No newline at end of file diff --git a/2022/11/01/360独立版小工具/index.html b/2022/11/01/360独立版小工具/index.html index 7cd145492..fc8dbea6f 100644 --- a/2022/11/01/360独立版小工具/index.html +++ b/2022/11/01/360独立版小工具/index.html @@ -1 +1 @@ -360 独立版小工具 - 工具 - Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 360 独立版小工具


360 全家桶众说纷纭但工具箱还是挺实用的,这波小工具可以单独下载使用,有需要的朋友赶紧下载吧!

下载地址

# 部分工具截图



更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +360 独立版小工具 - 工具 - Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 360 独立版小工具


360 全家桶众说纷纭但工具箱还是挺实用的,这波小工具可以单独下载使用,有需要的朋友赶紧下载吧!

下载地址

# 部分工具截图



更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/2022/11/02/2-dev-null和-dev-null-2-1和2-1-dev-null的区别/index.html b/2022/11/02/2-dev-null和-dev-null-2-1和2-1-dev-null的区别/index.html index 5c553cc9f..60d8490ba 100644 --- a/2022/11/02/2-dev-null和-dev-null-2-1和2-1-dev-null的区别/index.html +++ b/2022/11/02/2-dev-null和-dev-null-2-1和2-1-dev-null的区别/index.html @@ -1,8 +1,8 @@ -2>/dev/null 和 >/dev/null 2>&1 和 2>&1>/dev/null 的区别 - Shell - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 区别:

2>/dev/null
+2>/dev/null 和 >/dev/null 2>&1 和 2>&1>/dev/null 的区别 - Shell - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 区别:

2>/dev/null
 

意思就是把错误输出到 “黑洞”

>/dev/null 2>&1
 

默认情况是 1,也就是等同于 1>/dev/null 2>&1。意思就是把标准输出重定向到 “黑洞”,还把错误输出 2 重定向到标准输出 1,也就是标准输出和错误输出都进了 “黑洞”

2>&1 >/dev/null
 

意思就是把错误输出 2 重定向到标准出书 1,也就是屏幕,标准输出进了 “黑洞”,也就是标准输出进了黑洞,错误输出打印到屏幕

# 解释:

  1. 文件描述符
    Linux 系统预留三个文件描述符:0、1 和 2,他们的意义如下所示:
    0—— 标准输入(stdin)
    略...
    1—— 标准输出(stdout)
    在当前目录下,有且只有一个文件名称为 a.txt 的文件,这时我们运行这个命令【ls a.txt】, 就会获得一个标准输出 stdout 的输出结果:a.txt

    2—— 标准错误(stderr)
    在当前目录下,有且只有一个文件名称为 a.txt 的文件,我们运行命令【ls b.txt】,我们就会获得一个标准错误 stderr 的输出结果 “ls:无法访问 b.txt:没有这样的文件或目录”。

  2. 重定向
    重定向的符号有两个:> 或 >>,两者的区别是:前者会先清空文件,然后再写入内容,后者会将重定向的内容追加到现有文件的尾部。举例如下:

  • 重定向标准输出 stdout

    如上图所示,对比没有添加重定向的操作,这条命令在使用之后并没有将 a.txt 打印到屏幕。在紧接的 cat 操作后,可以发现本来应该被输出的内容被记录到 stdout.txt 中。

  • 重定向标准错误 stderr

    如上图所示,文件描述符 2,标准错误的重定向也是同样的原理被记录在了文件 stderr.txt 这个文件里面了。

  • 可以将 stderr 单独定向到一个文件,stdout 重定向到另一个文件

ls b.txt 2> stderr.txt 1>stdout.txt
 
  • 也可以将 stderr 和 stdout 重定向到同一个文件
ls b.txt > output.txt 2>&1
 
  • 或采用下面的方法,可以少写几个字,能达到同样的效果
ls b.txt &> output.txt
 ls b.txt >& output.txt #两个表达式效果一样的
-
  1. Linux 特殊文件
    /dev/null 是一个特殊的设备文件,这个文件接收到任何数据都会被丢弃。因此,null 这个设备通常也被称为位桶(bit bucket)或黑洞。
    所以,2>/dev/null 的意思就是将标准错误 stderr 删掉。
\ No newline at end of file +
  1. Linux 特殊文件
    /dev/null 是一个特殊的设备文件,这个文件接收到任何数据都会被丢弃。因此,null 这个设备通常也被称为位桶(bit bucket)或黑洞。
    所以,2>/dev/null 的意思就是将标准错误 stderr 删掉。
\ No newline at end of file diff --git a/2022/11/03/上班了/index.html b/2022/11/03/上班了/index.html index 01882dcc1..13c269ca8 100644 --- a/2022/11/03/上班了/index.html +++ b/2022/11/03/上班了/index.html @@ -1 +1 @@ -上班了 - 心情 - 生活 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
  • 终于又上班了。O (∩_∩) O~
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +上班了 - 心情 - 生活 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
  • 终于又上班了。O (∩_∩) O~
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/2022/11/04/记一次Vue项目的部署/index.html b/2022/11/04/记一次Vue项目的部署/index.html index 9728ed45c..550c4e0e1 100644 --- a/2022/11/04/记一次Vue项目的部署/index.html +++ b/2022/11/04/记一次Vue项目的部署/index.html @@ -1,4 +1,4 @@ -记一次 Vue 项目的部署 - 项目部署 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 描述

  • 今天需要把一个 web 项目部署到 ubuntu 服务器上,结果直接使用 apt install nodejs 安装的 nodejs 版本过低,导致编译失败。最后通过查看官网文档获取到了 ubuntu 最新 nodejs 的安装命令。

# 过程

  • 卸载旧的 nodejs(此命令会卸载掉相关依赖包)
sudo apt autoremove --purge nodejs
+记一次 Vue 项目的部署 - 项目部署 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 描述

  • 今天需要把一个 web 项目部署到 ubuntu 服务器上,结果直接使用 apt install nodejs 安装的 nodejs 版本过低,导致编译失败。最后通过查看官网文档获取到了 ubuntu 最新 nodejs 的安装命令。

# 过程

  • 卸载旧的 nodejs(此命令会卸载掉相关依赖包)
sudo apt autoremove --purge nodejs
 
  • 安装 NodeJS
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && sudo apt-get install -y nodejs
 
  • 安装 yarn
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
 
@@ -8,7 +8,7 @@ sudo apt-get update && sudo apt-get install yarn
 
  • 初始化 (到项目根目录执行)
yarn install
 
  • 编译(到项目根目录执行,完成后会生成 dist 目录)
yarn build
 
  • 安装 nginx
apt install nginx
-
  • 配置 nginx (编译 /etc/nginx/sites-available/default)
server {
+
  • 配置 nginx (编译 /etc/nginx/sites-available/default)
server {
         listen 80 default_server;
         listen [::]:80 default_server;
 
@@ -56,4 +56,4 @@ sudo apt-get update && sudo apt-get install yarn
 

# 其它

  • 重新编译前需要先删除 dist 目录
rm dist -fr
 
 yarn build
-
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/2022/11/08/Nginx配置-反向代理/index.html b/2022/11/08/Nginx配置-反向代理/index.html index be77860e8..b9a1972c4 100644 --- a/2022/11/08/Nginx配置-反向代理/index.html +++ b/2022/11/08/Nginx配置-反向代理/index.html @@ -1,8 +1,40 @@ -Nginx 配置 - 反向代理 - Nginx - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 引言

  • 所有配置方法和介绍均来至于网络搜索汇总,主要用于方便后期巩固学习。

# 何为反向代理

  • 在介绍反向代理之前,先来了解一下正向代理。

__正向代理:__如果把局域网外的 Internet 想象成一个巨大的资源库,则局域网中的客户端要访问 Internet,则需要通过代理服务器来访问,这种代理服务就称为正向代理,下面是正向代理的原理图。
991a203be1ec82b36e1f326376617d40.png
__反向代理:__看下面原理图,就一目了然。其实客户端对代理是无感知的,因为客户端不需要任何配置就可以访问,我们只需要将请求发送到反向代理服务器,由反向代理服务器去选择目标服务器获取数据后,在返回给客户端,此时反向代理服务器和目标服务器对外就是一个服务器,暴露的是代理服务器地址,隐藏了真实服务器 IP 地址。
1c87e386a0ce624a3949bda443cf346d.png

正向代理和反向代理的区别,一句话就是:如果我们客户端自己用,就是正向代理。如果是在服务器用,用户无感知,就是反向代理。

# Nginx 配置文件

  • 在学习 Nginx 之前,要熟知它的配置文件,毕竟,下面需要做的所有配置(反向代理、负载均衡、动静分离等),都是基于它的配置文件。

  • Nginx 默认的配置文件是在安装目录下的 conf 目录下,后续对 Nginx 的使用基本上都是对此配置文件进行相应的修改。完整的配置文件,可以看一下文章最后。修改过 nginx.conf 配置文件,记得要重启 Nginx 服务(☆☆☆☆☆)

  • 配置文件中有很多 #号,该符号表示注释内容,去掉所有以 #开头的段落,精简之后的配置文件内容如下(PS:其实注释掉的地方,都是一些功能的使用代码,需要用到的时候,取消注释即可):

# 主进程叫master,负责管理子进程,子进程叫worker
# worker_processes配置项表示开启几个业务进程,一般和cpu核数有关
worker_processes  1;
events {
    worker_connections  1024;
}
http {
	# include表示可以引入其他文件,此处表示引入http mime类型
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
	# 虚拟主机,可以配置多个
    server {
        listen       80;
        server_name  localhost;
        location / {
        	# 路径匹配之后,哪个目录下去匹配相应的网页,html是相对路径
            root   html;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
	}
}

去掉注释信息后,可以将 nginx.conf 配置文件分为三部分:

  1. 全局块
worker_processes  1;
-

从配置文件开始到 events 块之间的内容,主要会设置一些影响 Nginx 服务器整体运行的配置指令,主要包括:配置运行 Nginx 服务器的用户(组)、允许生成的 worker process 数,进程 PID 存放路径、日志存放路径和类型以及配置文件的引入等。

上面这行 worker_processes 配置,是 Nginx 服务器并发处理服务的关键配置,该值越大,可以支持的并发处理量也越多,但是会受到硬件、软件等设备的约束。

  1. events 块
events {
+Nginx 配置 - 反向代理 - Nginx - 服务 - Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 引言

  • 所有配置方法和介绍均来至于网络搜索汇总,主要用于方便后期巩固学习。

# 何为反向代理

  • 在介绍反向代理之前,先来了解一下正向代理。

__正向代理:__如果把局域网外的 Internet 想象成一个巨大的资源库,则局域网中的客户端要访问 Internet,则需要通过代理服务器来访问,这种代理服务就称为正向代理,下面是正向代理的原理图。
991a203be1ec82b36e1f326376617d40.png
__反向代理:__看下面原理图,就一目了然。其实客户端对代理是无感知的,因为客户端不需要任何配置就可以访问,我们只需要将请求发送到反向代理服务器,由反向代理服务器去选择目标服务器获取数据后,在返回给客户端,此时反向代理服务器和目标服务器对外就是一个服务器,暴露的是代理服务器地址,隐藏了真实服务器 IP 地址。
1c87e386a0ce624a3949bda443cf346d.png

正向代理和反向代理的区别,一句话就是:如果我们客户端自己用,就是正向代理。如果是在服务器用,用户无感知,就是反向代理。

# Nginx 配置文件

  • 在学习 Nginx 之前,要熟知它的配置文件,毕竟,下面需要做的所有配置(反向代理、负载均衡、动静分离等),都是基于它的配置文件。

  • Nginx 默认的配置文件是在安装目录下的 conf 目录下,后续对 Nginx 的使用基本上都是对此配置文件进行相应的修改。完整的配置文件,可以看一下文章最后。修改过 nginx.conf 配置文件,记得要重启 Nginx 服务(☆☆☆☆☆)

  • 配置文件中有很多 #号,该符号表示注释内容,去掉所有以 #开头的段落,精简之后的配置文件内容如下(PS:其实注释掉的地方,都是一些功能的使用代码,需要用到的时候,取消注释即可):

# 主进程叫master,负责管理子进程,子进程叫worker
+# worker_processes配置项表示开启几个业务进程,一般和cpu核数有关
+worker_processes  1;
+
+events {
+    worker_connections  1024;
+}
+
+http {
+	# include表示可以引入其他文件,此处表示引入http mime类型
+    include       mime.types;
+    default_type  application/octet-stream;
+    sendfile        on;
+    keepalive_timeout  65;
+
+	# 虚拟主机,可以配置多个
+    server {
+        listen       80;
+        server_name  localhost;
+
+        location / {
+        	# 路径匹配之后,哪个目录下去匹配相应的网页,html是相对路径
+            root   html;
+            index  index.html index.htm;
+        }
+
+        error_page   500 502 503 504  /50x.html;
+        location = /50x.html {
+            root   html;
+        }
+	}
+}
+

去掉注释信息后,可以将 nginx.conf 配置文件分为三部分:

  1. 全局块
worker_processes  1;
+

从配置文件开始到 events 块之间的内容,主要会设置一些影响 Nginx 服务器整体运行的配置指令,主要包括:配置运行 Nginx 服务器的用户(组)、允许生成的 worker process 数,进程 PID 存放路径、日志存放路径和类型以及配置文件的引入等。

上面这行 worker_processes 配置,是 Nginx 服务器并发处理服务的关键配置,该值越大,可以支持的并发处理量也越多,但是会受到硬件、软件等设备的约束。

  1. events 块
events {
 	worker_connections  1024;
 }
-

events 块涉及的指令主要影响 Nginx 服务器与用户的网络连接,常用的设置包括:是否开启对多 work process 下的网络连接进行序列化,是否允许同时接收多个网络连接,选取哪种事件驱动模型来处理连接请求,每个 work process 可以同时支持的最大连接数等

上述例子就表示每个 work process 支持的最大连接数为 1024。这部分的配置对 Nginx 的性能影响较大,在实际中应该灵活配置。

  1. http 块
http {
+

events 块涉及的指令主要影响 Nginx 服务器与用户的网络连接,常用的设置包括:是否开启对多 work process 下的网络连接进行序列化,是否允许同时接收多个网络连接,选取哪种事件驱动模型来处理连接请求,每个 work process 可以同时支持的最大连接数等

上述例子就表示每个 work process 支持的最大连接数为 1024。这部分的配置对 Nginx 的性能影响较大,在实际中应该灵活配置。

  1. http 块
http {
     include       mime.types;
     default_type  application/octet-stream;
     sendfile        on;
@@ -22,21 +54,20 @@
             root   html;
     }
 }
-

这部分是 Nginx 服务器配置中最频繁的部分,代理、缓存和日志定义等绝大多数功能和第三方模块的配置都在这里。需要注意的是:http 块也可以包括 http 全局块、server 块。下面的反向代理、动静分离、负载均衡都是在这部分中配置

__http 全局块:__http 全局块配置的指令包括:文件引入、MIME-TYPE 定义、日志自定义、连接超时时间、单链接请求数上限等。

__server 块:__这块和虚拟主机有密切关系,从用户角度看,虚拟主机和一台独立的硬件主机是完全一样的,该技术的产生是为了节省互联网服务器硬件成本。

__location 块:__这块的主要作用是:基于 Nginx 服务器接收到的请求字符串(例如 server_name/uri-string),对虚拟主机名称(也可以是 IP 别名)之外的字符串(例如 前面的 /uri-string)进行匹配,对特定的请求进行处理。地址定向、数据缓存和应答控制等功能,还有许多第三方模块的配置也在这里进行。

每个 http 块可以包括多个 server 块,而每个 server 块就相当于一个虚拟主机。而每个 server 块也分为全局 server 块,以及可以同时包含多个 locaton 块。(☆☆☆☆☆)

# 反向代理配置

  1. location 配置规则
location [ = | ~ | ~* | ^~ | @ ] /uri {
+

这部分是 Nginx 服务器配置中最频繁的部分,代理、缓存和日志定义等绝大多数功能和第三方模块的配置都在这里。需要注意的是:http 块也可以包括 http 全局块、server 块。下面的反向代理、动静分离、负载均衡都是在这部分中配置

__http 全局块:__http 全局块配置的指令包括:文件引入、MIME-TYPE 定义、日志自定义、连接超时时间、单链接请求数上限等。

__server 块:__这块和虚拟主机有密切关系,从用户角度看,虚拟主机和一台独立的硬件主机是完全一样的,该技术的产生是为了节省互联网服务器硬件成本。

__location 块:__这块的主要作用是:基于 Nginx 服务器接收到的请求字符串(例如 server_name/uri-string),对虚拟主机名称(也可以是 IP 别名)之外的字符串(例如 前面的 /uri-string)进行匹配,对特定的请求进行处理。地址定向、数据缓存和应答控制等功能,还有许多第三方模块的配置也在这里进行。

每个 http 块可以包括多个 server 块,而每个 server 块就相当于一个虚拟主机。而每个 server 块也分为全局 server 块,以及可以同时包含多个 locaton 块。(☆☆☆☆☆)

# 反向代理配置

  1. location 配置规则
location [ = | ~ | ~* | ^~ | @ ] /uri {
 
 }
 
-= :用于不含正则表达式的 uri 前,要求请求字符串与 uri 严格匹配,如果匹配成功,就停止继续向下搜索并立即处理该请求。
-~:用于表示 uri 包含正则表达式,并且区分大小写。
-~*:用于表示 uri 包含正则表达式,并且不区分大小写。
-^~:用于不含正则表达式的 uri 前,要求 Nginx 服务器找到标识 uri 和请求字符串匹配度最高的 location
-后,立即使用此 location 处理请求,而不再使用 location 块中的正则 uri 和请求字符串做匹配。
-@: "@" 定义一个命名的 location,使用在内部定向时,例如 error_page
-/uri:不带任何修饰符,也表示前缀匹配,但是在正则匹配之后,如果没有正则命中,命中最长的规则
-/:通用匹配,任何未匹配到其它location的请求都会匹配到,相当于switch中的default
+=    :用于不含正则表达式的 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等。而有“/”结尾时,location /abc/def/不能匹配/abc/defghi请求,只能匹配/abc/def/anything这样的请求
-
  1. proxy_pass 配置规则
url结尾加上了/,相当于是绝对路径,则Nginx不会把location中匹配的路径部分加入代理uri。
+☆☆☆☆☆ uri没有“/”结尾时,location /abc/def可以匹配/abc/defghi请求,也可以匹配/abc/def/ghi等。而有“/”结尾时,location /abc/def/不能匹配/abc/defghi请求,只能匹配/abc/def/anything这样的请求
+
  1. proxy_pass 配置规则
url结尾加上了/,相当于是绝对路径,则Nginx不会把location中匹配的路径部分加入代理uri。
 url结尾不加/,Nginx则会把匹配的路径部分加入代理uri。
 
 情景1:
@@ -91,7 +122,7 @@ proxy_pass后有/
 location /model {
 	proxy_pass   http://127.0.0.1:8082/;
 }
-

# Nginx 完整配置文件

#user  nobody;
+

# Nginx 完整配置文件

#user  nobody;
 worker_processes  1;
 
 #error_log  logs/error.log;
@@ -198,4 +229,4 @@ http {
     #    }
     #}
 }
-
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/404.html b/404.html index b1956bb14..b19b36a14 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -Σ( ° △ °|||)︴404!何も見えない | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
Σ( ° △ °|||)︴404!何も見えない
\ No newline at end of file +Σ( ° △ °|||)︴404!何も見えない | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
Σ( ° △ °|||)︴404!何も見えない
\ No newline at end of file diff --git a/about/me.html b/about/me.html index c71966ef4..07abfa12d 100644 --- a/about/me.html +++ b/about/me.html @@ -1 +1 @@ -| ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 个人信息

  • 姓名:李海涛
  • 性别:男
  • 学历:本科
  • 生肖:鼠
  • 星座:天秤

# 个人爱好

  • 跑步
  • 篮球
  • 听歌
  • 电影

# 编程语言

  • java
  • python
  • php

# 项目经历 - 近期

  1. 智能量化决策交易系统

    该项目主要用于对期货、股票等进行智能化交易,会根据用户事先设置的规则决策是否买卖,并给出信号、收益、最大回撤等详细的统计报告及分析报表。 该项目采用Spring Cloud微服务解决方案,主要功能模块分为行情采集、策略计算、交易信号处理、账户交易服务、ctp网关、策略统计、消息推送等 该项目使用IntellIJ做为主要开发工具,前端使用vue框架,图表采用tradingview、highchart等。后端使用mybatis、mysql对部分用户、策略、配置信息进行存储,kafka做为行情数据、交易信号等消息中间件。使用redis存储当日分时行情等临时数据,mongodb用于存储分析结果、信号历史,hbase存储期货行情等详细数据。使用netty框架实现实时消息推送。
  2. IWB-EX 交易平台

    该项目主要依托流行的区块链技术进行白酒的销售。以虚拟币为货币,白酒为等价商品进行交易。当虚拟币价格过低时用户可以选择实物白酒进行提货。使用IntellIJ做为开发工具,采用的技术有springMVC、mysql、thymeleaf等。
  3. 废品回收管理平台

    该项目主要为废品回收公司提供废品的进出库管理和统计,并打印详细价格单据等。该项目分为两个平台,给用户使用的入库填表平台和给企业管理人员使用的审核、管理后台。使用IntellIJ做为开发工具,采用的技术有springMVC、mysql、freemarker等。
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file +| ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

# 个人信息

  • 姓名:李海涛
  • 性别:男
  • 学历:本科
  • 生肖:鼠
  • 星座:天秤

# 个人爱好

  • 跑步
  • 篮球
  • 听歌
  • 电影

# 编程语言

  • java
  • python
  • php

# 项目经历 - 近期

  1. 智能量化决策交易系统

    该项目主要用于对期货、股票等进行智能化交易,会根据用户事先设置的规则决策是否买卖,并给出信号、收益、最大回撤等详细的统计报告及分析报表。 该项目采用Spring Cloud微服务解决方案,主要功能模块分为行情采集、策略计算、交易信号处理、账户交易服务、ctp网关、策略统计、消息推送等 该项目使用IntellIJ做为主要开发工具,前端使用vue框架,图表采用tradingview、highchart等。后端使用mybatis、mysql对部分用户、策略、配置信息进行存储,kafka做为行情数据、交易信号等消息中间件。使用redis存储当日分时行情等临时数据,mongodb用于存储分析结果、信号历史,hbase存储期货行情等详细数据。使用netty框架实现实时消息推送。
  2. IWB-EX 交易平台

    该项目主要依托流行的区块链技术进行白酒的销售。以虚拟币为货币,白酒为等价商品进行交易。当虚拟币价格过低时用户可以选择实物白酒进行提货。使用IntellIJ做为开发工具,采用的技术有springMVC、mysql、thymeleaf等。
  3. 废品回收管理平台

    该项目主要为废品回收公司提供废品的进出库管理和统计,并打印详细价格单据等。该项目分为两个平台,给用户使用的入库填表平台和给企业管理人员使用的审核、管理后台。使用IntellIJ做为开发工具,采用的技术有springMVC、mysql、freemarker等。
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Hito Li 微信支付

微信支付

Hito Li 支付宝

支付宝

\ No newline at end of file diff --git a/archives/2022/09/index.html b/archives/2022/09/index.html index ff2b0f4b8..20b0e1761 100644 --- a/archives/2022/09/index.html +++ b/archives/2022/09/index.html @@ -1 +1 @@ -2022 年 / 09 月 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +2022 年 / 09 月 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/archives/2022/10/index.html b/archives/2022/10/index.html index 6646b91c9..cc82048e2 100644 --- a/archives/2022/10/index.html +++ b/archives/2022/10/index.html @@ -1 +1 @@ -2022 年 / 10 月 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +2022 年 / 10 月 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/archives/2022/10/page/2/index.html b/archives/2022/10/page/2/index.html index aff943af6..f7e6e9321 100644 --- a/archives/2022/10/page/2/index.html +++ b/archives/2022/10/page/2/index.html @@ -1 +1 @@ -2022 年 / 10 月 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +2022 年 / 10 月 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/archives/2022/11/index.html b/archives/2022/11/index.html index 6cad5567d..c55c18fa9 100644 --- a/archives/2022/11/index.html +++ b/archives/2022/11/index.html @@ -1 +1 @@ -2022 年 / 11 月 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +2022 年 / 11 月 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/archives/2022/index.html b/archives/2022/index.html index 04f31e105..6e60f609c 100644 --- a/archives/2022/index.html +++ b/archives/2022/index.html @@ -1 +1 @@ -2022 年 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +2022 年 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/archives/2022/page/2/index.html b/archives/2022/page/2/index.html index 56b75e667..0262e5112 100644 --- a/archives/2022/page/2/index.html +++ b/archives/2022/page/2/index.html @@ -1 +1 @@ -2022 年 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +2022 年 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/archives/2022/page/3/index.html b/archives/2022/page/3/index.html index dd703fde7..c310c28b3 100644 --- a/archives/2022/page/3/index.html +++ b/archives/2022/page/3/index.html @@ -1 +1 @@ -2022 年 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +2022 年 - 归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/archives/index.html b/archives/index.html index 506e20bfb..188b83f69 100644 --- a/archives/index.html +++ b/archives/index.html @@ -1 +1 @@ -归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

首页 / 目前共计 27 篇文章。 嗯.. 继续努力。

2022 年/11 月 ( 5 )

2022 年/10 月 ( 13 )

2022 年/09 月 ( 9 )

\ No newline at end of file +归档 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

首页 / 目前共计 27 篇文章。 嗯.. 继续努力。

2022 年/11 月 ( 5 )

2022 年/10 月 ( 13 )

2022 年/09 月 ( 9 )

\ No newline at end of file diff --git a/atom.xml b/atom.xml index c3d5d5ab9..4077e9816 100644 --- a/atom.xml +++ b/atom.xml @@ -48,18 +48,51 @@ __反向代理:__看下面原理图,就一目了然。其实客户端对代 <p>配置文件中有很多 #号,该符号表示注释内容,去掉所有以 #开头的段落,精简之后的配置文件内容如下(PS:其实注释掉的地方,都是一些功能的使用代码,需要用到的时候,取消注释即可):</p> </li> </ul> -<figure class="highlight xml"><figcaption data-lang="XML"></figcaption><table><tr><td data-num="1"></td><td><pre># 主进程叫master,负责管理子进程,子进程叫worker</pre></td></tr><tr><td data-num="2"></td><td><pre># worker_processes配置项表示开启几个业务进程,一般和cpu核数有关</pre></td></tr><tr><td data-num="3"></td><td><pre>worker_processes 1;</pre></td></tr><tr><td data-num="4"></td><td><pre></pre></td></tr><tr><td data-num="5"></td><td><pre>events &#123;</pre></td></tr><tr><td data-num="6"></td><td><pre> worker_connections 1024;</pre></td></tr><tr><td data-num="7"></td><td><pre>&#125;</pre></td></tr><tr><td data-num="8"></td><td><pre></pre></td></tr><tr><td data-num="9"></td><td><pre>http &#123;</pre></td></tr><tr><td data-num="10"></td><td><pre> # include表示可以引入其他文件,此处表示引入http mime类型</pre></td></tr><tr><td data-num="11"></td><td><pre> include mime.types;</pre></td></tr><tr><td data-num="12"></td><td><pre> default_type application/octet-stream;</pre></td></tr><tr><td data-num="13"></td><td><pre> sendfile on;</pre></td></tr><tr><td data-num="14"></td><td><pre> keepalive_timeout 65;</pre></td></tr><tr><td data-num="15"></td><td><pre></pre></td></tr><tr><td data-num="16"></td><td><pre> # 虚拟主机,可以配置多个</pre></td></tr><tr><td data-num="17"></td><td><pre> server &#123;</pre></td></tr><tr><td data-num="18"></td><td><pre> listen 80;</pre></td></tr><tr><td data-num="19"></td><td><pre> server_name localhost;</pre></td></tr><tr><td data-num="20"></td><td><pre></pre></td></tr><tr><td data-num="21"></td><td><pre> location / &#123;</pre></td></tr><tr><td data-num="22"></td><td><pre> # 路径匹配之后,哪个目录下去匹配相应的网页,html是相对路径</pre></td></tr><tr><td data-num="23"></td><td><pre> root html;</pre></td></tr><tr><td data-num="24"></td><td><pre> index index.html index.htm;</pre></td></tr><tr><td data-num="25"></td><td><pre> &#125;</pre></td></tr><tr><td data-num="26"></td><td><pre></pre></td></tr><tr><td data-num="27"></td><td><pre> error_page 500 502 503 504 /50x.html;</pre></td></tr><tr><td data-num="28"></td><td><pre> location = /50x.html &#123;</pre></td></tr><tr><td data-num="29"></td><td><pre> root html;</pre></td></tr><tr><td data-num="30"></td><td><pre> &#125;</pre></td></tr><tr><td data-num="31"></td><td><pre> &#125;</pre></td></tr><tr><td data-num="32"></td><td><pre>&#125;</pre></td></tr></table></figure><p>去掉注释信息后,可以将 nginx.conf 配置文件分为三部分:</p> +<pre><code class="language-yaml"># 主进程叫master,负责管理子进程,子进程叫worker +# worker_processes配置项表示开启几个业务进程,一般和cpu核数有关 +worker_processes 1; + +events &#123; + worker_connections 1024; +&#125; + +http &#123; + # include表示可以引入其他文件,此处表示引入http mime类型 + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + # 虚拟主机,可以配置多个 + server &#123; + listen 80; + server_name localhost; + + location / &#123; + # 路径匹配之后,哪个目录下去匹配相应的网页,html是相对路径 + root html; + index index.html index.htm; + &#125; + + error_page 500 502 503 504 /50x.html; + location = /50x.html &#123; + root html; + &#125; + &#125; +&#125; +</code></pre> +<p>去掉注释信息后,可以将 nginx.conf 配置文件分为三部分:</p> <ol> <li>全局块</li> </ol> -<pre><code class="language-conf">worker_processes 1; +<pre><code class="language-yaml">worker_processes 1; </code></pre> <p>从配置文件开始到 events 块之间的内容,主要会设置一些影响 Nginx 服务器整体运行的配置指令,主要包括:配置运行 Nginx 服务器的用户(组)、允许生成的 worker process 数,进程 PID 存放路径、日志存放路径和类型以及配置文件的引入等。</p> <p>上面这行 worker_processes 配置,是 Nginx 服务器并发处理服务的关键配置,该值越大,可以支持的并发处理量也越多,但是会受到硬件、软件等设备的约束。</p> <ol start="2"> <li>events 块</li> </ol> -<pre><code class="language-conf">events &#123; +<pre><code class="language-yaml">events &#123; worker_connections 1024; &#125; </code></pre> @@ -68,7 +101,7 @@ __反向代理:__看下面原理图,就一目了然。其实客户端对代 <ol start="3"> <li>http 块</li> </ol> -<pre><code class="language-conf">http &#123; +<pre><code class="language-yaml">http &#123; include mime.types; default_type application/octet-stream; sendfile on; @@ -98,25 +131,24 @@ __反向代理:__看下面原理图,就一目了然。其实客户端对代 <ol> <li>location 配置规则</li> </ol> -<pre><code class="language-conf">location [ = | ~ | ~* | ^~ | @ ] /uri &#123; +<pre><code class="language-yaml">location [ = | ~ | ~* | ^~ | @ ] /uri &#123; &#125; -= :用于不含正则表达式的 uri 前,要求请求字符串与 uri 严格匹配,如果匹配成功,就停止继续向下搜索并立即处理该请求。 -~:用于表示 uri 包含正则表达式,并且区分大小写。 -~*:用于表示 uri 包含正则表达式,并且不区分大小写。 -^~:用于不含正则表达式的 uri 前,要求 Nginx 服务器找到标识 uri 和请求字符串匹配度最高的 location -后,立即使用此 location 处理请求,而不再使用 location 块中的正则 uri 和请求字符串做匹配。 -@: &quot;@&quot; 定义一个命名的 location,使用在内部定向时,例如 error_page -/uri:不带任何修饰符,也表示前缀匹配,但是在正则匹配之后,如果没有正则命中,命中最长的规则 -/:通用匹配,任何未匹配到其它location的请求都会匹配到,相当于switch中的default +=   :用于不含正则表达式的 uri 前,要求请求字符串与 uri 严格匹配,如果匹配成功,就停止继续向下搜索并立即处理该请求。 +~ :用于表示 uri 包含正则表达式,并且区分大小写。 +~* :用于表示 uri 包含正则表达式,并且不区分大小写。 +^~ :用于不含正则表达式的 uri 前,要求 Nginx 服务器找到标识 uri 和请求字符串匹配度最高的location后,立即使用此 location 处理请求,而不再使用 location 块中的正则 uri 和请求字符串做匹配。 +@ : &quot;@&quot; 定义一个命名的 location,使用在内部定向时,例如 error_page +/uri :不带任何修饰符,也表示前缀匹配,但是在正则匹配之后,如果没有正则命中,命中最长的规则 +/ :通用匹配,任何未匹配到其它location的请求都会匹配到,相当于switch中的default -* uri没有“/”结尾时,location /abc/def可以匹配/abc/defghi请求,也可以匹配/abc/def/ghi等。而有“/”结尾时,location /abc/def/不能匹配/abc/defghi请求,只能匹配/abc/def/anything这样的请求 +☆☆☆☆☆ uri没有“/”结尾时,location /abc/def可以匹配/abc/defghi请求,也可以匹配/abc/def/ghi等。而有“/”结尾时,location /abc/def/不能匹配/abc/defghi请求,只能匹配/abc/def/anything这样的请求 </code></pre> <ol start="2"> <li>proxy_pass 配置规则</li> </ol> -<pre><code class="language-conf">url结尾加上了/,相当于是绝对路径,则Nginx不会把location中匹配的路径部分加入代理uri。 +<pre><code class="language-yaml">url结尾加上了/,相当于是绝对路径,则Nginx不会把location中匹配的路径部分加入代理uri。 url结尾不加/,Nginx则会把匹配的路径部分加入代理uri。 情景1: @@ -173,7 +205,7 @@ location /model &#123; &#125; </code></pre> <h4 id="nginx完整配置文件"><a class="anchor" href="#nginx完整配置文件">#</a> Nginx 完整配置文件</h4> -<pre><code class="language-conf">#user nobody; +<pre><code class="language-yaml">#user nobody; worker_processes 1; #error_log logs/error.log; @@ -335,7 +367,7 @@ sudo apt-get update &amp;&amp; sudo apt-get install yarn <ul> <li>配置 nginx (编译 /etc/nginx/sites-available/default)</li> </ul> -<pre><code class="language-conf">server &#123; +<pre><code class="language-yaml">server &#123; listen 80 default_server; listen [::]:80 default_server; @@ -535,7 +567,7 @@ ls b.txt &gt;&amp; output.txt #两个表达式效果一样的 <li>证书生成好并放置到 nginx 上。(证书生成方法不做介绍请自行百度)</li> <li>http 跳转 https 配置</li> </ol> -<pre><code class="language-conf">server &#123; +<pre><code class="language-yaml">server &#123; if ($scheme = http) &#123; rewrite ^(.*)$ https://$host$1 permanent; &#125; @@ -544,7 +576,7 @@ ls b.txt &gt;&amp; output.txt #两个表达式效果一样的 <ol start="4"> <li>web 端口监听配置</li> </ol> -<pre><code class="language-conf">#极空间-web +<pre><code class="language-yaml">#极空间-web server &#123; listen 10000 ssl http2; #ipv4 listen [::]:10000 ssl http2; #ipv6 @@ -637,7 +669,7 @@ server &#123; <li>路径映射(由于青龙面板有 nodejs 环境,所以我把 hexo 博客的编译也放置在上面,再把 nginx 的 html 映射过来,这样就可以直接编译发布了。)<br /> <img data-src="https://file.jingxiyuan.cn/images/2022/10/24/2022-10-24-19-29-06.jpg" alt="" /></li> </ul> -<pre><code class="language-conf">#青龙面板装载路径 +<pre><code class="language-yaml">#青龙面板装载路径 /ql/data #博客装载路径(如果你不部署hexo博客可以不用配置) /root/.ssh  #ssh证书文件(如果你不用把hexo推送到git上可以不用配置) @@ -664,13 +696,13 @@ server &#123; <code>0 */3 * * *</code></li> <li>环境变量</li> </ul> -<pre><code class="language-conf">名称:JD_COOKIE +<pre><code class="language-yaml">名称:JD_COOKIE 值:web京东登陆后按F12在网络tab页中的请求内查找cookie,然后复制pt_key=到pt_pin=等 </code></pre> <ul> <li>配置文件 (主要修改和添加以下配置)</li> </ul> -<pre><code class="language-conf">repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可 +<pre><code class="language-yaml">repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可 RepoFileExtensions=&quot;js py ts&quot; 钉钉(消息推送) export DD_BOT_TOKEN= @@ -702,7 +734,7 @@ export JD_PAY_CONTRACT=true <ul> <li>依赖管理</li> </ul> -<pre><code class="language-conf">#nodejs依赖 +<pre><code class="language-yaml">#nodejs依赖 crypto-js prettytable dotenv @@ -795,7 +827,7 @@ curl -sS https://bootstrap.pypa.io/get-pip.py | python3 <img data-src="https://file.jingxiyuan.cn/images/2022/10/21/2022-10-21-11-54-32204f14d87e95b59e.jpg" alt="" /></li> </ol> <h4 id="修改themeshoka配置"><a class="anchor" href="#修改themeshoka配置">#</a> 修改 Theme.Shoka 配置</h4> -<pre><code class="language-yml">valine: +<pre><code class="language-yaml">valine:  appId: 粘贴5中获取的App ID #Your_appId appKey: 粘贴5中获取的App Key #Your_appkey placeholder: ヽ(○´∀`)ノ♪欢迎畅所欲言 # Comment box placeholder @@ -859,7 +891,7 @@ curl -sS https://bootstrap.pypa.io/get-pip.py | python3 <ul> <li>此处配置为 nginx 反向代理,配置完成后可在外网连接访问</li> </ul> -<pre><code class="language-conf">stream &#123; +<pre><code class="language-yaml">stream &#123; #极空间-docker-mariadb upstream mariadb &#123; @@ -1219,7 +1251,7 @@ sudo systemctl status ndo2db.service <ol> <li>基础配置</li> </ol> -<pre><code class="language-conf">port 6379 +<pre><code class="language-yaml">port 6379 requirepass 123456(密码,建议不设置) vm-enabled no (虚拟内存,内存够的情况下可以不使用) maxmemory 1GB(告诉Redis当使用了多少物理内存后就开始拒绝后续的写入) @@ -1247,7 +1279,7 @@ echo never &gt; /sys/kernel/mm/transparent_hugepage/enabled <ol start="4"> <li>客户端缓冲区限制</li> </ol> -<pre><code class="language-conf">客户端的输出缓冲区的限制,因为某种原因客户端从服务器读取数据的速度不够快,可用于强制断开连接(一个常见的原因是一个发布 / 订阅客户端消费消息的速度无法赶上生产它们的速度)。 +<pre><code class="language-yaml">客户端的输出缓冲区的限制,因为某种原因客户端从服务器读取数据的速度不够快,可用于强制断开连接(一个常见的原因是一个发布 / 订阅客户端消费消息的速度无法赶上生产它们的速度)。 可以三种不同客户端的方式进行设置: normal -&gt; 正常客户端 slave -&gt; slave 和 MONITOR 客户端 @@ -1265,7 +1297,7 @@ client-output-buffer-limit pubsub 32mb 8mb 60 <ol start="5"> <li>持久化配置</li> </ol> -<pre><code class="language-conf">---关闭RDB持久化--- +<pre><code class="language-yaml">---关闭RDB持久化--- save &quot;&quot; 默认配置如下: save 900 1 #900秒内有1次更新就持久化 @@ -1290,7 +1322,7 @@ min-slaves-to-write 3 min-slaves-max-lag 10 设置当一个master端的可用slave少于N个,延迟时间大于M秒时,不接收写操作。 </code></pre> <h4 id="从服务"><a class="anchor" href="#从服务">#</a> 从服务</h4> -<pre><code class="language-conf">基本配置同主服务一致 +<pre><code class="language-yaml">基本配置同主服务一致 slaveof 127.0.0.1 6379(主redis的ip和端口) masterauth 123456 (主redis的密码) 可以通过slaveof no one命令将Slaver升级为Maste @@ -1331,7 +1363,7 @@ sudo sysctl vm.overcommit_memory=1 <h4 id="使用场景"><a class="anchor" href="#使用场景">#</a> 使用场景</h4> <p>  在 A 域名的页面向 B 域名提交数据时需要代入 B 域名的 cookie,否则 B 域名会跳转到登陆页面。解决方式需要使用到 nginx 反向代理,配置如下:</p> -<pre><code class="language-conf">server &#123; +<pre><code class="language-yaml">server &#123; listen port ssl http2; server_name xxx.com; ssl_certificate_key /xxx.key; @@ -1469,7 +1501,7 @@ X-Frame-Options 三个参数:</p> <li>轮询(默认)</li> </ol> <p>  <em>每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。</em></p> -<pre><code class="language-conf">upstream my_server &#123; +<pre><code class="language-yaml">upstream my_server &#123; server 192.168.0.2:8080; server 192.168.0.3:8080; &#125; @@ -1489,7 +1521,7 @@ server &#123; <li>weight 权重策略</li> </ol> <p>  <em>weight 代表权重,默认为 1,权重越高被分配的客户端越多,指定轮询几率。weight 和访问比率成正比,用于后端服务器性能不均的情况。</em></p> -<pre><code class="language-conf">upstream my_server &#123; +<pre><code class="language-yaml">upstream my_server &#123; server 192.168.0.2:8080 weight=1; server 192.168.0.3:8080 weight=2; &#125; @@ -1509,7 +1541,7 @@ server &#123; <li>ip_hash</li> </ol> <p>  <em>每个请求按访问 ip 的 hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决 session 的问题。</em></p> -<pre><code class="language-conf">upstream my_server &#123; +<pre><code class="language-yaml">upstream my_server &#123; ip_hash; server 192.168.0.2:8080; server 192.168.0.3:8080; @@ -1530,7 +1562,7 @@ server &#123; <li>fair (第三方)</li> </ol> <p>  <em>按后端服务器的响应时间来分配请求,响应时间短的优先分配。</em></p> -<pre><code class="language-conf">upstream my_server &#123; +<pre><code class="language-yaml">upstream my_server &#123; server 192.168.0.2:8080; server 192.168.0.3:8080; fair; diff --git a/categories/Linux/Shell/index.html b/categories/Linux/Shell/index.html index 138867870..abb28e0f2 100644 --- a/categories/Linux/Shell/index.html +++ b/categories/Linux/Shell/index.html @@ -1 +1 @@ -分类:Shell | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:Shell | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/Linux/index.html b/categories/Linux/index.html index bc76aa7cb..9c7ff7234 100644 --- a/categories/Linux/index.html +++ b/categories/Linux/index.html @@ -1 +1 @@ -分类:Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:Linux | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/Linux/服务/Nginx/index.html b/categories/Linux/服务/Nginx/index.html index 6c9335fac..628d1febb 100644 --- a/categories/Linux/服务/Nginx/index.html +++ b/categories/Linux/服务/Nginx/index.html @@ -1 +1 @@ -分类:Nginx | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:Nginx | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/Linux/服务/index.html b/categories/Linux/服务/index.html index ac5fd8676..128c81eee 100644 --- a/categories/Linux/服务/index.html +++ b/categories/Linux/服务/index.html @@ -1 +1 @@ -分类:服务 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:服务 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/Linux/项目部署/index.html b/categories/Linux/项目部署/index.html index e4fcb8fab..2b6ffeb57 100644 --- a/categories/Linux/项目部署/index.html +++ b/categories/Linux/项目部署/index.html @@ -1 +1 @@ -分类:项目部署 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:项目部署 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/Windows/index.html b/categories/Windows/index.html index af838a126..c81a3d3be 100644 --- a/categories/Windows/index.html +++ b/categories/Windows/index.html @@ -1 +1 @@ -分类:Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:Windows | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/Windows/工具/index.html b/categories/Windows/工具/index.html index 37e8760d0..5bebbb5a2 100644 --- a/categories/Windows/工具/index.html +++ b/categories/Windows/工具/index.html @@ -1 +1 @@ -分类:工具 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:工具 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/index.html b/categories/index.html index dc4c1bbea..25f7735d6 100644 --- a/categories/index.html +++ b/categories/index.html @@ -1 +1 @@ -全部分类 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

首页 / 目前共计 13 个分类

( 9 )

( 1 )

( 7 )

( 5 )

( 1 )

( 5 )

( 5 )

( 9 )

( 8 )

( 4 )
\ No newline at end of file +全部分类 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

首页 / 目前共计 13 个分类

( 9 )

( 1 )

( 7 )

( 5 )

( 1 )

( 5 )

( 5 )

( 9 )

( 8 )

( 4 )
\ No newline at end of file diff --git a/categories/极空间/Docker/Hexo/index.html b/categories/极空间/Docker/Hexo/index.html index 6a43dea74..b88122af4 100644 --- a/categories/极空间/Docker/Hexo/index.html +++ b/categories/极空间/Docker/Hexo/index.html @@ -1 +1 @@ -分类:Hexo | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:Hexo | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/极空间/Docker/index.html b/categories/极空间/Docker/index.html index d4d4e2afc..6bdcc6168 100644 --- a/categories/极空间/Docker/index.html +++ b/categories/极空间/Docker/index.html @@ -1 +1 @@ -分类:Docker | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:Docker | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/极空间/index.html b/categories/极空间/index.html index 567857c63..baf12e438 100644 --- a/categories/极空间/index.html +++ b/categories/极空间/index.html @@ -1 +1 @@ -分类:极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/生活/index.html b/categories/生活/index.html index 8e7ae0757..feb707140 100644 --- a/categories/生活/index.html +++ b/categories/生活/index.html @@ -1 +1 @@ -分类:生活 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:生活 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/生活/心得体会/index.html b/categories/生活/心得体会/index.html index c3bc54774..d41253534 100644 --- a/categories/生活/心得体会/index.html +++ b/categories/生活/心得体会/index.html @@ -1 +1 @@ -分类:心得体会 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:心得体会 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/categories/生活/心情/index.html b/categories/生活/心情/index.html index 3ba5b3028..a87b4fb46 100644 --- a/categories/生活/心情/index.html +++ b/categories/生活/心情/index.html @@ -1 +1 @@ -分类:心情 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +分类:心情 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/feed.json b/feed.json index 17b5f605f..49b1922ff 100644 --- a/feed.json +++ b/feed.json @@ -11,7 +11,7 @@ "url": "https://blog.jingxiyuan.cn/2022/11/08/Nginx%E9%85%8D%E7%BD%AE-%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86/", "title": "Nginx配置-反向代理", "date_published": "2022-11-08T02:05:00.000Z", - "content_html": "

# 引言

\n\n

# 何为反向代理

\n\n

__正向代理:__如果把局域网外的 Internet 想象成一个巨大的资源库,则局域网中的客户端要访问 Internet,则需要通过代理服务器来访问,这种代理服务就称为正向代理,下面是正向代理的原理图。
\n\"991a203be1ec82b36e1f326376617d40.png\"
\n__反向代理:__看下面原理图,就一目了然。其实客户端对代理是无感知的,因为客户端不需要任何配置就可以访问,我们只需要将请求发送到反向代理服务器,由反向代理服务器去选择目标服务器获取数据后,在返回给客户端,此时反向代理服务器和目标服务器对外就是一个服务器,暴露的是代理服务器地址,隐藏了真实服务器 IP 地址。
\n\"1c87e386a0ce624a3949bda443cf346d.png\"

\n
\n

正向代理和反向代理的区别,一句话就是:如果我们客户端自己用,就是正向代理。如果是在服务器用,用户无感知,就是反向代理。

\n
\n

# Nginx 配置文件

\n\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}
}

去掉注释信息后,可以将 nginx.conf 配置文件分为三部分:

\n
    \n
  1. 全局块
  2. \n
\n
worker_processes  1;\n
\n

从配置文件开始到 events 块之间的内容,主要会设置一些影响 Nginx 服务器整体运行的配置指令,主要包括:配置运行 Nginx 服务器的用户(组)、允许生成的 worker process 数,进程 PID 存放路径、日志存放路径和类型以及配置文件的引入等。

\n

上面这行 worker_processes 配置,是 Nginx 服务器并发处理服务的关键配置,该值越大,可以支持的并发处理量也越多,但是会受到硬件、软件等设备的约束。

\n
    \n
  1. events 块
  2. \n
\n
events {\n\tworker_connections  1024;\n}\n
\n

events 块涉及的指令主要影响 Nginx 服务器与用户的网络连接,常用的设置包括:是否开启对多 work process 下的网络连接进行序列化,是否允许同时接收多个网络连接,选取哪种事件驱动模型来处理连接请求,每个 work process 可以同时支持的最大连接数等

\n

上述例子就表示每个 work process 支持的最大连接数为 1024。这部分的配置对 Nginx 的性能影响较大,在实际中应该灵活配置。

\n
    \n
  1. http 块
  2. \n
\n
http {\n    include       mime.types;\n    default_type  application/octet-stream;\n    sendfile        on;\n    keepalive_timeout  65;\n\n    server {\n        listen       80;\n        server_name  localhost;\n\n        location / {\n            root   html;\n            index  index.html index.htm;\n        }\n\n        error_page   500 502 503 504  /50x.html;\n        location = /50x.html {\n            root   html;\n    }\n}\n
\n

这部分是 Nginx 服务器配置中最频繁的部分,代理、缓存和日志定义等绝大多数功能和第三方模块的配置都在这里。需要注意的是:http 块也可以包括 http 全局块、server 块。下面的反向代理、动静分离、负载均衡都是在这部分中配置

\n

__http 全局块:__http 全局块配置的指令包括:文件引入、MIME-TYPE 定义、日志自定义、连接超时时间、单链接请求数上限等。

\n

__server 块:__这块和虚拟主机有密切关系,从用户角度看,虚拟主机和一台独立的硬件主机是完全一样的,该技术的产生是为了节省互联网服务器硬件成本。

\n

__location 块:__这块的主要作用是:基于 Nginx 服务器接收到的请求字符串(例如 server_name/uri-string),对虚拟主机名称(也可以是 IP 别名)之外的字符串(例如 前面的 /uri-string)进行匹配,对特定的请求进行处理。地址定向、数据缓存和应答控制等功能,还有许多第三方模块的配置也在这里进行。

\n

每个 http 块可以包括多个 server 块,而每个 server 块就相当于一个虚拟主机。而每个 server 块也分为全局 server 块,以及可以同时包含多个 locaton 块。(☆☆☆☆☆)

\n

# 反向代理配置

\n
    \n
  1. location 配置规则
  2. \n
\n
location [ = | ~ | ~* | ^~ | @ ] /uri {\n\n}\n\n= :用于不含正则表达式的 uri 前,要求请求字符串与 uri 严格匹配,如果匹配成功,就停止继续向下搜索并立即处理该请求。\n~:用于表示 uri 包含正则表达式,并且区分大小写。\n~*:用于表示 uri 包含正则表达式,并且不区分大小写。\n^~:用于不含正则表达式的 uri 前,要求 Nginx 服务器找到标识 uri 和请求字符串匹配度最高的 location\n后,立即使用此 location 处理请求,而不再使用 location 块中的正则 uri 和请求字符串做匹配。\n@: "@" 定义一个命名的 location,使用在内部定向时,例如 error_page\n/uri:不带任何修饰符,也表示前缀匹配,但是在正则匹配之后,如果没有正则命中,命中最长的规则\n/:通用匹配,任何未匹配到其它location的请求都会匹配到,相当于switch中的default\n\n* uri没有“/”结尾时,location /abc/def可以匹配/abc/defghi请求,也可以匹配/abc/def/ghi等。而有“/”结尾时,location /abc/def/不能匹配/abc/defghi请求,只能匹配/abc/def/anything这样的请求\n
\n
    \n
  1. proxy_pass 配置规则
  2. \n
\n
url结尾加上了/,相当于是绝对路径,则Nginx不会把location中匹配的路径部分加入代理uri。\nurl结尾不加/,Nginx则会把匹配的路径部分加入代理uri。\n\n情景1:\nproxy_pass后有/ \n访问地址:http://localhost:8081/WCP.Service/wcp/modeladapter/download/asc.shtml\n最终代理:http://10.194.171.7:13082/modeladapter/download/asc.shtml\nlocation /WCP.Service/wcp/modeladapter/download/ {\n\tproxy_pass   http://10.194.171.7:13082/modeladapter/download/;\n}\n访问地址:http://localhost:8081/model/asc.shtml\n最终代理:http://127.0.0.1:8082/model/asc.shtml\nlocation /model/ {\n\tproxy_pass   http://127.0.0.1:8082/model/;\n}\n\n情景2:\nproxy_pass后有/\n访问地址:http://localhost:8081/model/asc.shtml\n最终代理:http://127.0.0.1:8082/asc.shtml\nlocation /model/ {\n\tproxy_pass   http://127.0.0.1:8082/;\n}\n\n情景3:\nproxy_pass后没有/ \n访问地址:http://localhost:8081/model/asc.shtml\n最终代理:http://127.0.0.1:8082/model/asc.shtml\nlocation /model/ {\n\tproxy_pass   http://127.0.0.1:8082;\n}\n\n情景4\nproxy_pass后没有/ \n访问地址:http://localhost:8081/model/asc.shtml\n最终代理:http://127.0.0.1:8082/AAAmodel/asc.shtml\nlocation /model/ {\n\tproxy_pass   http://127.0.0.1:8082/AAA;\n}\n\n情景5\nproxy_pass后有/\n访问地址:http://localhost:8081/model/asc.shtml\n最终代理:http://127.0.0.1:8082/asc.shtml\nlocation /model {\n\tproxy_pass   http://127.0.0.1:8082/;\n}\n\n情景6\nproxy_pass后有/\n访问地址:http://localhost:8081/modelBBB/asc.shtml\n最终代理:http://127.0.0.1:8082/asc.shtml\nlocation /model {\n\tproxy_pass   http://127.0.0.1:8082/;\n}\n
\n

# Nginx 完整配置文件

\n
#user  nobody;\nworker_processes  1;\n\n#error_log  logs/error.log;\n#error_log  logs/error.log  notice;\n#error_log  logs/error.log  info;\n\n#pid        logs/nginx.pid;\n\nevents {\n    worker_connections  1024;\n}\n\nhttp {\n    include       mime.types;\n    default_type  application/octet-stream;\n\n    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '\n    #                  '$status $body_bytes_sent "$http_referer" '\n    #                  '"$http_user_agent" "$http_x_forwarded_for"';\n\n    #access_log  logs/access.log  main;\n\n    sendfile        on;\n    #tcp_nopush     on;\n\n    #keepalive_timeout  0;\n    keepalive_timeout  65;\n\n    #gzip  on;\n\n    server {\n        listen       80;\n        server_name  localhost;\n\n        #charset koi8-r;\n\n        #access_log  logs/host.access.log  main;\n\n        location / {\n            root   html;\n            index  index.html index.htm;\n        }\n\n        #error_page  404              /404.html;\n\n        # redirect server error pages to the static page /50x.html\n        #\n        error_page   500 502 503 504  /50x.html;\n        location = /50x.html {\n            root   html;\n        }\n\n        # proxy the PHP scripts to Apache listening on 127.0.0.1:80\n        #\n        #location ~ \\.php$ {\n        #    proxy_pass   http://127.0.0.1;\n        #}\n\n        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\n        #\n        #location ~ \\.php$ {\n        #    root           html;\n        #    fastcgi_pass   127.0.0.1:9000;\n        #    fastcgi_index  index.php;\n        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;\n        #    include        fastcgi_params;\n        #}\n\n        # deny access to .htaccess files, if Apache's document root\n        # concurs with nginx's one\n        #\n        #location ~ /\\.ht {\n        #    deny  all;\n        #}\n    }\n    # another virtual host using mix of IP-, name-, and port-based configuration\n    #\n    #server {\n    #    listen       8000;\n    #    listen       somename:8080;\n    #    server_name  somename  alias  another.alias;\n    #    location / {\n    #        root   html;\n    #        index  index.html index.htm;\n    #    }\n    #}\n    # HTTPS server\n    #\n    #server {\n    #    listen       443 ssl;\n    #    server_name  localhost;\n    #    ssl_certificate      cert.pem;\n    #    ssl_certificate_key  cert.key;\n\n    #    ssl_session_cache    shared:SSL:1m;\n    #    ssl_session_timeout  5m;\n\n    #    ssl_ciphers  HIGH:!aNULL:!MD5;\n    #    ssl_prefer_server_ciphers  on;\n\n    #    location / {\n    #        root   html;\n    #        index  index.html index.htm;\n    #    }\n    #}\n}\n
\n", + "content_html": "

# 引言

\n\n

# 何为反向代理

\n\n

__正向代理:__如果把局域网外的 Internet 想象成一个巨大的资源库,则局域网中的客户端要访问 Internet,则需要通过代理服务器来访问,这种代理服务就称为正向代理,下面是正向代理的原理图。
\n\"991a203be1ec82b36e1f326376617d40.png\"
\n__反向代理:__看下面原理图,就一目了然。其实客户端对代理是无感知的,因为客户端不需要任何配置就可以访问,我们只需要将请求发送到反向代理服务器,由反向代理服务器去选择目标服务器获取数据后,在返回给客户端,此时反向代理服务器和目标服务器对外就是一个服务器,暴露的是代理服务器地址,隐藏了真实服务器 IP 地址。
\n\"1c87e386a0ce624a3949bda443cf346d.png\"

\n
\n

正向代理和反向代理的区别,一句话就是:如果我们客户端自己用,就是正向代理。如果是在服务器用,用户无感知,就是反向代理。

\n
\n

# Nginx 配置文件

\n\n
# 主进程叫master,负责管理子进程,子进程叫worker\n# worker_processes配置项表示开启几个业务进程,一般和cpu核数有关\nworker_processes  1;\n\nevents {\n    worker_connections  1024;\n}\n\nhttp {\n\t# include表示可以引入其他文件,此处表示引入http mime类型\n    include       mime.types;\n    default_type  application/octet-stream;\n    sendfile        on;\n    keepalive_timeout  65;\n\n\t# 虚拟主机,可以配置多个\n    server {\n        listen       80;\n        server_name  localhost;\n\n        location / {\n        \t# 路径匹配之后,哪个目录下去匹配相应的网页,html是相对路径\n            root   html;\n            index  index.html index.htm;\n        }\n\n        error_page   500 502 503 504  /50x.html;\n        location = /50x.html {\n            root   html;\n        }\n\t}\n}\n
\n

去掉注释信息后,可以将 nginx.conf 配置文件分为三部分:

\n
    \n
  1. 全局块
  2. \n
\n
worker_processes  1;\n
\n

从配置文件开始到 events 块之间的内容,主要会设置一些影响 Nginx 服务器整体运行的配置指令,主要包括:配置运行 Nginx 服务器的用户(组)、允许生成的 worker process 数,进程 PID 存放路径、日志存放路径和类型以及配置文件的引入等。

\n

上面这行 worker_processes 配置,是 Nginx 服务器并发处理服务的关键配置,该值越大,可以支持的并发处理量也越多,但是会受到硬件、软件等设备的约束。

\n
    \n
  1. events 块
  2. \n
\n
events {\n\tworker_connections  1024;\n}\n
\n

events 块涉及的指令主要影响 Nginx 服务器与用户的网络连接,常用的设置包括:是否开启对多 work process 下的网络连接进行序列化,是否允许同时接收多个网络连接,选取哪种事件驱动模型来处理连接请求,每个 work process 可以同时支持的最大连接数等

\n

上述例子就表示每个 work process 支持的最大连接数为 1024。这部分的配置对 Nginx 的性能影响较大,在实际中应该灵活配置。

\n
    \n
  1. http 块
  2. \n
\n
http {\n    include       mime.types;\n    default_type  application/octet-stream;\n    sendfile        on;\n    keepalive_timeout  65;\n\n    server {\n        listen       80;\n        server_name  localhost;\n\n        location / {\n            root   html;\n            index  index.html index.htm;\n        }\n\n        error_page   500 502 503 504  /50x.html;\n        location = /50x.html {\n            root   html;\n    }\n}\n
\n

这部分是 Nginx 服务器配置中最频繁的部分,代理、缓存和日志定义等绝大多数功能和第三方模块的配置都在这里。需要注意的是:http 块也可以包括 http 全局块、server 块。下面的反向代理、动静分离、负载均衡都是在这部分中配置

\n

__http 全局块:__http 全局块配置的指令包括:文件引入、MIME-TYPE 定义、日志自定义、连接超时时间、单链接请求数上限等。

\n

__server 块:__这块和虚拟主机有密切关系,从用户角度看,虚拟主机和一台独立的硬件主机是完全一样的,该技术的产生是为了节省互联网服务器硬件成本。

\n

__location 块:__这块的主要作用是:基于 Nginx 服务器接收到的请求字符串(例如 server_name/uri-string),对虚拟主机名称(也可以是 IP 别名)之外的字符串(例如 前面的 /uri-string)进行匹配,对特定的请求进行处理。地址定向、数据缓存和应答控制等功能,还有许多第三方模块的配置也在这里进行。

\n

每个 http 块可以包括多个 server 块,而每个 server 块就相当于一个虚拟主机。而每个 server 块也分为全局 server 块,以及可以同时包含多个 locaton 块。(☆☆☆☆☆)

\n

# 反向代理配置

\n
    \n
  1. location 配置规则
  2. \n
\n
location [ = | ~ | ~* | ^~ | @ ] /uri {\n\n}\n\n=    :用于不含正则表达式的 uri 前,要求请求字符串与 uri 严格匹配,如果匹配成功,就停止继续向下搜索并立即处理该请求。\n~    :用于表示 uri 包含正则表达式,并且区分大小写。\n~*   :用于表示 uri 包含正则表达式,并且不区分大小写。\n^~   :用于不含正则表达式的 uri 前,要求 Nginx 服务器找到标识 uri 和请求字符串匹配度最高的location后,立即使用此 location 处理请求,而不再使用 location 块中的正则 uri 和请求字符串做匹配。\n@    : "@" 定义一个命名的 location,使用在内部定向时,例如 error_page\n/uri  :不带任何修饰符,也表示前缀匹配,但是在正则匹配之后,如果没有正则命中,命中最长的规则\n/    :通用匹配,任何未匹配到其它location的请求都会匹配到,相当于switch中的default\n\n☆☆☆☆☆ uri没有“/”结尾时,location /abc/def可以匹配/abc/defghi请求,也可以匹配/abc/def/ghi等。而有“/”结尾时,location /abc/def/不能匹配/abc/defghi请求,只能匹配/abc/def/anything这样的请求\n
\n
    \n
  1. proxy_pass 配置规则
  2. \n
\n
url结尾加上了/,相当于是绝对路径,则Nginx不会把location中匹配的路径部分加入代理uri。\nurl结尾不加/,Nginx则会把匹配的路径部分加入代理uri。\n\n情景1:\nproxy_pass后有/ \n访问地址:http://localhost:8081/WCP.Service/wcp/modeladapter/download/asc.shtml\n最终代理:http://10.194.171.7:13082/modeladapter/download/asc.shtml\nlocation /WCP.Service/wcp/modeladapter/download/ {\n\tproxy_pass   http://10.194.171.7:13082/modeladapter/download/;\n}\n访问地址:http://localhost:8081/model/asc.shtml\n最终代理:http://127.0.0.1:8082/model/asc.shtml\nlocation /model/ {\n\tproxy_pass   http://127.0.0.1:8082/model/;\n}\n\n情景2:\nproxy_pass后有/\n访问地址:http://localhost:8081/model/asc.shtml\n最终代理:http://127.0.0.1:8082/asc.shtml\nlocation /model/ {\n\tproxy_pass   http://127.0.0.1:8082/;\n}\n\n情景3:\nproxy_pass后没有/ \n访问地址:http://localhost:8081/model/asc.shtml\n最终代理:http://127.0.0.1:8082/model/asc.shtml\nlocation /model/ {\n\tproxy_pass   http://127.0.0.1:8082;\n}\n\n情景4\nproxy_pass后没有/ \n访问地址:http://localhost:8081/model/asc.shtml\n最终代理:http://127.0.0.1:8082/AAAmodel/asc.shtml\nlocation /model/ {\n\tproxy_pass   http://127.0.0.1:8082/AAA;\n}\n\n情景5\nproxy_pass后有/\n访问地址:http://localhost:8081/model/asc.shtml\n最终代理:http://127.0.0.1:8082/asc.shtml\nlocation /model {\n\tproxy_pass   http://127.0.0.1:8082/;\n}\n\n情景6\nproxy_pass后有/\n访问地址:http://localhost:8081/modelBBB/asc.shtml\n最终代理:http://127.0.0.1:8082/asc.shtml\nlocation /model {\n\tproxy_pass   http://127.0.0.1:8082/;\n}\n
\n

# Nginx 完整配置文件

\n
#user  nobody;\nworker_processes  1;\n\n#error_log  logs/error.log;\n#error_log  logs/error.log  notice;\n#error_log  logs/error.log  info;\n\n#pid        logs/nginx.pid;\n\nevents {\n    worker_connections  1024;\n}\n\nhttp {\n    include       mime.types;\n    default_type  application/octet-stream;\n\n    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '\n    #                  '$status $body_bytes_sent "$http_referer" '\n    #                  '"$http_user_agent" "$http_x_forwarded_for"';\n\n    #access_log  logs/access.log  main;\n\n    sendfile        on;\n    #tcp_nopush     on;\n\n    #keepalive_timeout  0;\n    keepalive_timeout  65;\n\n    #gzip  on;\n\n    server {\n        listen       80;\n        server_name  localhost;\n\n        #charset koi8-r;\n\n        #access_log  logs/host.access.log  main;\n\n        location / {\n            root   html;\n            index  index.html index.htm;\n        }\n\n        #error_page  404              /404.html;\n\n        # redirect server error pages to the static page /50x.html\n        #\n        error_page   500 502 503 504  /50x.html;\n        location = /50x.html {\n            root   html;\n        }\n\n        # proxy the PHP scripts to Apache listening on 127.0.0.1:80\n        #\n        #location ~ \\.php$ {\n        #    proxy_pass   http://127.0.0.1;\n        #}\n\n        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\n        #\n        #location ~ \\.php$ {\n        #    root           html;\n        #    fastcgi_pass   127.0.0.1:9000;\n        #    fastcgi_index  index.php;\n        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;\n        #    include        fastcgi_params;\n        #}\n\n        # deny access to .htaccess files, if Apache's document root\n        # concurs with nginx's one\n        #\n        #location ~ /\\.ht {\n        #    deny  all;\n        #}\n    }\n    # another virtual host using mix of IP-, name-, and port-based configuration\n    #\n    #server {\n    #    listen       8000;\n    #    listen       somename:8080;\n    #    server_name  somename  alias  another.alias;\n    #    location / {\n    #        root   html;\n    #        index  index.html index.htm;\n    #    }\n    #}\n    # HTTPS server\n    #\n    #server {\n    #    listen       443 ssl;\n    #    server_name  localhost;\n    #    ssl_certificate      cert.pem;\n    #    ssl_certificate_key  cert.key;\n\n    #    ssl_session_cache    shared:SSL:1m;\n    #    ssl_session_timeout  5m;\n\n    #    ssl_ciphers  HIGH:!aNULL:!MD5;\n    #    ssl_prefer_server_ciphers  on;\n\n    #    location / {\n    #        root   html;\n    #        index  index.html index.htm;\n    #    }\n    #}\n}\n
\n", "tags": [ "Linux", "服务", @@ -25,7 +25,7 @@ "url": "https://blog.jingxiyuan.cn/2022/11/04/%E8%AE%B0%E4%B8%80%E6%AC%A1Vue%E9%A1%B9%E7%9B%AE%E7%9A%84%E9%83%A8%E7%BD%B2/", "title": "记一次Vue项目的部署", "date_published": "2022-11-04T07:21:00.000Z", - "content_html": "

# 描述

\n\n

# 过程

\n\n
sudo apt autoremove --purge nodejs\n
\n\n
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && sudo apt-get install -y nodejs\n
\n\n
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null\n\necho "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list\n\nsudo apt-get update && sudo apt-get install yarn\n
\n\n
yarn install\n
\n\n
yarn build\n
\n\n
apt install nginx\n
\n\n
server {\n        listen 80 default_server;\n        listen [::]:80 default_server;\n\n        # SSL configuration\n        #\n        # listen 443 ssl default_server;\n        # listen [::]:443 ssl default_server;\n        #\n        # Note: You should disable gzip for SSL traffic.\n        # See: https://bugs.debian.org/773332\n        #\n        # Read up on ssl_ciphers to ensure a secure configuration.\n        # See: https://bugs.debian.org/765782\n        #\n        # Self signed certs generated by the ssl-cert package\n        # Don't use them in a production server!\n        #\n        # include snippets/snakeoil.conf;\n\n        root /var/www/html;\n\n        # Add index.php to the list if you are using PHP\n        index index.html index.htm index.nginx-debian.html;\n\n        server_name _;\n\n        location /api {\n                proxy_pass http://localhost:8080;\n        }\n\n        location / {\n                # First attempt to serve request as file, then\n                # as directory, then fall back to displaying a 404.\n                #try_files $uri $uri/ =404;\n                alias /opt/codes/dayu-tools-arbitrage-web/dist/;\n                try_files $uri $uri/ @router;\n                index index.html index.htm;\n        }\n\n        location @router {\n                rewrite ^.*$ /index.html last;\n        }\n}\n\n
\n

# 其它

\n\n
rm dist -fr\n\nyarn build\n
\n", + "content_html": "

# 描述

\n\n

# 过程

\n\n
sudo apt autoremove --purge nodejs\n
\n\n
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && sudo apt-get install -y nodejs\n
\n\n
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null\n\necho "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list\n\nsudo apt-get update && sudo apt-get install yarn\n
\n\n
yarn install\n
\n\n
yarn build\n
\n\n
apt install nginx\n
\n\n
server {\n        listen 80 default_server;\n        listen [::]:80 default_server;\n\n        # SSL configuration\n        #\n        # listen 443 ssl default_server;\n        # listen [::]:443 ssl default_server;\n        #\n        # Note: You should disable gzip for SSL traffic.\n        # See: https://bugs.debian.org/773332\n        #\n        # Read up on ssl_ciphers to ensure a secure configuration.\n        # See: https://bugs.debian.org/765782\n        #\n        # Self signed certs generated by the ssl-cert package\n        # Don't use them in a production server!\n        #\n        # include snippets/snakeoil.conf;\n\n        root /var/www/html;\n\n        # Add index.php to the list if you are using PHP\n        index index.html index.htm index.nginx-debian.html;\n\n        server_name _;\n\n        location /api {\n                proxy_pass http://localhost:8080;\n        }\n\n        location / {\n                # First attempt to serve request as file, then\n                # as directory, then fall back to displaying a 404.\n                #try_files $uri $uri/ =404;\n                alias /opt/codes/dayu-tools-arbitrage-web/dist/;\n                try_files $uri $uri/ @router;\n                index index.html index.htm;\n        }\n\n        location @router {\n                rewrite ^.*$ /index.html last;\n        }\n}\n\n
\n

# 其它

\n\n
rm dist -fr\n\nyarn build\n
\n", "tags": [ "Linux", "项目部署", @@ -90,7 +90,7 @@ "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": "

# 介绍

\n\n

# 配置

\n
    \n
  1. 需要先把 10000 端口在路由器上做好映射。
  2. \n
  3. 证书生成好并放置到 nginx 上。(证书生成方法不做介绍请自行百度)
  4. \n
  5. http 跳转 https 配置
  6. \n
\n
server {\n\t\tif ($scheme = http) {\n\t\t\trewrite ^(.*)$ https://$host$1 permanent;\n\t\t}\n}\n
\n
    \n
  1. web 端口监听配置
  2. \n
\n
#极空间-web\nserver {\n\tlisten 10000 ssl http2; #ipv4\n\tlisten [::]:10000 ssl http2; #ipv6\n\tserver_name xxx.xxx.com; #填写自己的域名,主域名或者子域名\n\n\t#include /etc/nginx/conf.d/ssl/ssl_common.conf;\n\tssl_certificate_key /etc/nginx/conf.d/ssl/xxx.key;  #加密证书\n\tssl_certificate /etc/nginx/conf.d/ssl/xxx.pem;  #加密证书\n\tssl_session_timeout 1d;\n\tssl_session_cache shared:MozSSL:10m;\n\tssl_session_tickets off;\n\tssl_protocols TLSv1.2 TLSv1.3;\n\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;\n\tssl_prefer_server_ciphers on;\n\n   #开启OCSP stapling\n\tssl_stapling on;\n\tssl_stapling_verify on;\n\n\tclient_max_body_size 128M;\n\n\tadd_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload";\n\n\tproxy_send_timeout 180s; #设置发送超时时间\n   proxy_read_timeout 180s; #设置读取超时时间\n\n\t# Prevent Information leaks\n\tproxy_hide_header X-Powered-By;\n\tproxy_hide_header Server;\n\tproxy_hide_header X-AspNetMvc-Version;\n\tproxy_hide_header X-AspNet-Version;\n\n\t# http security headers\n\tadd_header X-Content-Type-Options nosniff;\n\tadd_header Pragma no-cache;\n\tadd_header Cache-Control no-store;\n\tadd_header X-XSS-Protection "1; mode=block";\n\tadd_header Referrer-Policy origin-when-cross-origin;\n\tadd_header X-Permitted-Cross-Domain-Policies none;\n   add_header X-Frame-Options SAMEORIGIN; #允许同域嵌套\n\n\t# Add Security cookie flags\n\tproxy_cookie_path ~(.*) "$1; SameSite=strict; secure; httponly";\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_intercept_errors on;\n\t\tproxy_max_temp_file_size 0;\n\t\tproxy_set_header Host $host;\n\t\tproxy_set_header X-Real-IP $remote_addr;\n\t\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\t\tproxy_set_header X-Forwarded-Proto $scheme;\n  \n\t\tproxy_pass http://极空间内网ip:5055; #这里设置你自己要跳转的局域网应用;\n\t\tproxy_redirect http://域名:5055/home https://域名:10000/home; #极空间在登陆后会跳转到http协议的5055端口,所以要在此替换为https协议的10000端口\n\t}\n\n\terror_page  500 502 503 504 /500.html;\n\terror_page  400 404 /500.html;\n\tlocation = /500.html {\n\t\troot /usr/share/nginx/html/; #错误html\n\t}\n}\n
\n

# 问题

\n\n", + "content_html": "

# 介绍

\n\n

# 配置

\n
    \n
  1. 需要先把 10000 端口在路由器上做好映射。
  2. \n
  3. 证书生成好并放置到 nginx 上。(证书生成方法不做介绍请自行百度)
  4. \n
  5. http 跳转 https 配置
  6. \n
\n
server {\n\t\tif ($scheme = http) {\n\t\t\trewrite ^(.*)$ https://$host$1 permanent;\n\t\t}\n}\n
\n
    \n
  1. web 端口监听配置
  2. \n
\n
#极空间-web\nserver {\n\tlisten 10000 ssl http2; #ipv4\n\tlisten [::]:10000 ssl http2; #ipv6\n\tserver_name xxx.xxx.com; #填写自己的域名,主域名或者子域名\n\n\t#include /etc/nginx/conf.d/ssl/ssl_common.conf;\n\tssl_certificate_key /etc/nginx/conf.d/ssl/xxx.key;  #加密证书\n\tssl_certificate /etc/nginx/conf.d/ssl/xxx.pem;  #加密证书\n\tssl_session_timeout 1d;\n\tssl_session_cache shared:MozSSL:10m;\n\tssl_session_tickets off;\n\tssl_protocols TLSv1.2 TLSv1.3;\n\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;\n\tssl_prefer_server_ciphers on;\n\n   #开启OCSP stapling\n\tssl_stapling on;\n\tssl_stapling_verify on;\n\n\tclient_max_body_size 128M;\n\n\tadd_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload";\n\n\tproxy_send_timeout 180s; #设置发送超时时间\n   proxy_read_timeout 180s; #设置读取超时时间\n\n\t# Prevent Information leaks\n\tproxy_hide_header X-Powered-By;\n\tproxy_hide_header Server;\n\tproxy_hide_header X-AspNetMvc-Version;\n\tproxy_hide_header X-AspNet-Version;\n\n\t# http security headers\n\tadd_header X-Content-Type-Options nosniff;\n\tadd_header Pragma no-cache;\n\tadd_header Cache-Control no-store;\n\tadd_header X-XSS-Protection "1; mode=block";\n\tadd_header Referrer-Policy origin-when-cross-origin;\n\tadd_header X-Permitted-Cross-Domain-Policies none;\n   add_header X-Frame-Options SAMEORIGIN; #允许同域嵌套\n\n\t# Add Security cookie flags\n\tproxy_cookie_path ~(.*) "$1; SameSite=strict; secure; httponly";\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_intercept_errors on;\n\t\tproxy_max_temp_file_size 0;\n\t\tproxy_set_header Host $host;\n\t\tproxy_set_header X-Real-IP $remote_addr;\n\t\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\t\tproxy_set_header X-Forwarded-Proto $scheme;\n  \n\t\tproxy_pass http://极空间内网ip:5055; #这里设置你自己要跳转的局域网应用;\n\t\tproxy_redirect http://域名:5055/home https://域名:10000/home; #极空间在登陆后会跳转到http协议的5055端口,所以要在此替换为https协议的10000端口\n\t}\n\n\terror_page  500 502 503 504 /500.html;\n\terror_page  400 404 /500.html;\n\tlocation = /500.html {\n\t\troot /usr/share/nginx/html/; #错误html\n\t}\n}\n
\n

# 问题

\n\n", "tags": [ "极空间", "nginx", @@ -104,7 +104,7 @@ "url": "https://blog.jingxiyuan.cn/2022/10/22/%E6%9E%81%E7%A9%BA%E9%97%B4Docker%E7%89%88%E9%9D%92%E9%BE%99%E9%9D%A2%E6%9D%BF%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/", "title": "极空间Docker版青龙面板安装与配置", "date_published": "2022-10-22T02:44:00.000Z", - "content_html": "

# 介绍

\n\n

# 安装

\n\n
#青龙面板装载路径\n/ql/data\n#博客装载路径(如果你不部署hexo博客可以不用配置)\n/root/.ssh  #ssh证书文件(如果你不用把hexo推送到git上可以不用配置)\n/blog      #hexo博客编译目录\n/blog/nginx_blog  #nginx上放置博客的目录(例如:/Docker/nginx/html/blog)\n
\n\n

# 配置

\n\n
名称:JD_COOKIE\n值:web京东登陆后按F12在网络tab页中的请求内查找cookie,然后复制pt_key=到pt_pin=等\n
\n\n
repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可\nRepoFileExtensions="js py ts"\n钉钉(消息推送)\nexport DD_BOT_TOKEN=\nexport DD_BOT_SECRET=\n##开卡\nexport guaopencard_All="true"\nexport guaopencard_addSku_All="true"\nexport guaopencardRun_All="true"\nexport guaopencard_draw="true"\nexport JD_TRY="true"\nexport exjxbeans="true"\nexport DY_OPENALL="true"\n#抽奖\nexport opencard_draw=3\n#开启脚本依赖文件缺失修复\nexport ec_fix_dep="true" \n#开启脚本依赖文件更新\nexport ec_re_dep="true" \n#清空购物车\nexport JD_CART_REMOVE="true"\nexport JD_CART="true"\n#去掉多余的双十一红包脚本\nexport FLCODE=''\n#加购物车抽奖\nexport RUN_CAR=true\n#停用小额免密支付\nexport JD_PAY_CONTRACT=true\n
\n\n
#nodejs依赖\ncrypto-js\t\nprettytable\t\ndotenv\t\njsdom\t\ndate-fns\t\ntough-cookie\t\ntslib\t\nws@7.4.3\t\nts-md5\t\njsdom -g\t\njieba\t\nfs\t\nform-data\t\njson5\t\nglobal-agent\t\npng-js\t\n@types/node\t\nrequire\t\ntypescript\t\njs-base64\t\naxios\n#pythone依赖\nrequests\t\ncanvas\t\nping3\t\njieba\t\naiohttp\t\nPyExecJS\n#Linux依赖\nbizCode\nbizMsg\nlxml\n
\n

# 其它

\n
#配置国内源\npip config --global set global.index-url https://mirrors.aliyun.com/pypi/simple/\npip config --global set install.trusted-host https://mirrors.aliyun.com\n\n#升级pip\npip install --upgrade pip\n\n#更新青龙\nql update\n\n#已知要安装的依赖(不安装部分脚本任务会失败)\npnpm install ds\n\n#一键安装所有依赖(基于Faker一键脚本安装的青龙\n可通过执行/ql/data/scripts下的QLDependency.sh脚本安装,如脚本已经更新则通过下面命令执行\ncurl -fsSL https://git.metauniverse-cn.com/https://raw.githubusercontent.com/shufflewzc/QLDependency/main/Shell/QLOneKeyDependency.sh | sh\n\n#一般出现这种错误:(缺依赖)\nError: Cannot find module 'xx'\n执行pnpm install xxx\n\n#一般出现这种错误:(缺文件)\nError: Cannot find module './xx'\n那就是拉库命令不完整,请检查或复制完整的拉库命\n\n#Python3依赖安装失败修复(基于Faker一键脚本安装的青龙)\ncurl -sS https://bootstrap.pypa.io/get-pip.py | python3\n
\n", + "content_html": "

# 介绍

\n\n

# 安装

\n\n
#青龙面板装载路径\n/ql/data\n#博客装载路径(如果你不部署hexo博客可以不用配置)\n/root/.ssh  #ssh证书文件(如果你不用把hexo推送到git上可以不用配置)\n/blog      #hexo博客编译目录\n/blog/nginx_blog  #nginx上放置博客的目录(例如:/Docker/nginx/html/blog)\n
\n\n

# 配置

\n\n
名称:JD_COOKIE\n值:web京东登陆后按F12在网络tab页中的请求内查找cookie,然后复制pt_key=到pt_pin=等\n
\n\n
repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可\nRepoFileExtensions="js py ts"\n钉钉(消息推送)\nexport DD_BOT_TOKEN=\nexport DD_BOT_SECRET=\n##开卡\nexport guaopencard_All="true"\nexport guaopencard_addSku_All="true"\nexport guaopencardRun_All="true"\nexport guaopencard_draw="true"\nexport JD_TRY="true"\nexport exjxbeans="true"\nexport DY_OPENALL="true"\n#抽奖\nexport opencard_draw=3\n#开启脚本依赖文件缺失修复\nexport ec_fix_dep="true" \n#开启脚本依赖文件更新\nexport ec_re_dep="true" \n#清空购物车\nexport JD_CART_REMOVE="true"\nexport JD_CART="true"\n#去掉多余的双十一红包脚本\nexport FLCODE=''\n#加购物车抽奖\nexport RUN_CAR=true\n#停用小额免密支付\nexport JD_PAY_CONTRACT=true\n
\n\n
#nodejs依赖\ncrypto-js\t\nprettytable\t\ndotenv\t\njsdom\t\ndate-fns\t\ntough-cookie\t\ntslib\t\nws@7.4.3\t\nts-md5\t\njsdom -g\t\njieba\t\nfs\t\nform-data\t\njson5\t\nglobal-agent\t\npng-js\t\n@types/node\t\nrequire\t\ntypescript\t\njs-base64\t\naxios\n#pythone依赖\nrequests\t\ncanvas\t\nping3\t\njieba\t\naiohttp\t\nPyExecJS\n#Linux依赖\nbizCode\nbizMsg\nlxml\n
\n

# 其它

\n
#配置国内源\npip config --global set global.index-url https://mirrors.aliyun.com/pypi/simple/\npip config --global set install.trusted-host https://mirrors.aliyun.com\n\n#升级pip\npip install --upgrade pip\n\n#更新青龙\nql update\n\n#已知要安装的依赖(不安装部分脚本任务会失败)\npnpm install ds\n\n#一键安装所有依赖(基于Faker一键脚本安装的青龙\n可通过执行/ql/data/scripts下的QLDependency.sh脚本安装,如脚本已经更新则通过下面命令执行\ncurl -fsSL https://git.metauniverse-cn.com/https://raw.githubusercontent.com/shufflewzc/QLDependency/main/Shell/QLOneKeyDependency.sh | sh\n\n#一般出现这种错误:(缺依赖)\nError: Cannot find module 'xx'\n执行pnpm install xxx\n\n#一般出现这种错误:(缺文件)\nError: Cannot find module './xx'\n那就是拉库命令不完整,请检查或复制完整的拉库命\n\n#Python3依赖安装失败修复(基于Faker一键脚本安装的青龙)\ncurl -sS https://bootstrap.pypa.io/get-pip.py | python3\n
\n", "tags": [ "极空间", "Docker", @@ -118,7 +118,7 @@ "url": "https://blog.jingxiyuan.cn/2022/10/21/Hexo-Theme-Shoka-Valine%E8%AF%84%E8%AE%BA%E9%85%8D%E7%BD%AE/", "title": "Hexo + Theme.Shoka + Valine评论配置", "date_published": "2022-10-21T03:48:00.000Z", - "content_html": "\n

# LeanCloud 注册

\n
    \n
  1. LeanCloud 网站完成注册。
  2. \n
  3. 创建应用。
    \n\"\"
  4. \n
  5. 名称随便取,方案看自己选择。开发版免费但是有限制,商业版收费无限制。
    \n\"\"
  6. \n
  7. 点击配置按钮进行配置。
    \n\"\"
  8. \n
  9. 点击设置 - 应用凭证可获取 App ID 和 App Key
    \n\"\"
  10. \n
  11. 点击设置 - 安全中心根据自己的需求配置
    \n\"\"
  12. \n
\n

# 修改 Theme.Shoka 配置

\n
valine:\n  appId: 粘贴5中获取的App ID #Your_appId\n  appKey: 粘贴5中获取的App Key #Your_appkey\n  placeholder: ヽ(○´∀`)ノ♪欢迎畅所欲言 # Comment box placeholder\n  avatar: mp #默认头像设置 Gravatar style : mp, identicon, monsterid, wavatar, robohash, retro\n  pageSize: 10 # Pagination size\n  lang: zh-CN\n  visitor: true # Article reading statistic 这个要设置为false,以免与 leancloud_visitors 突冲 \n  NoRecordIP: false # Whether to record the commenter IP\n  serverURLs: # When the custom domain name is enabled, fill it in here (it will be detected automatically by default, no need to fill in)\n  powerMode: true\n  tagMeta:\n    visitor: 新朋友\n    master: 博主\n    friend: 小伙伴\n    investor: 金主粑粑\n  tagColor:\n    master: "var(--color-orange)"\n    friend: "var(--color-aqua)"\n    investor: "var(--color-pink)"\n  tagMember:\n    master:\n      # - hash of master@email.com\n      # - hash of master2@email.com\n    friend:\n      # - hash of friend@email.com\n      # - hash of friend2@email.com\n    investor:\n      # - hash of investor1@email.com\n
\n", + "content_html": "\n

# LeanCloud 注册

\n
    \n
  1. LeanCloud 网站完成注册。
  2. \n
  3. 创建应用。
    \n\"\"
  4. \n
  5. 名称随便取,方案看自己选择。开发版免费但是有限制,商业版收费无限制。
    \n\"\"
  6. \n
  7. 点击配置按钮进行配置。
    \n\"\"
  8. \n
  9. 点击设置 - 应用凭证可获取 App ID 和 App Key
    \n\"\"
  10. \n
  11. 点击设置 - 安全中心根据自己的需求配置
    \n\"\"
  12. \n
\n

# 修改 Theme.Shoka 配置

\n
valine:\n  appId: 粘贴5中获取的App ID #Your_appId\n  appKey: 粘贴5中获取的App Key #Your_appkey\n  placeholder: ヽ(○´∀`)ノ♪欢迎畅所欲言 # Comment box placeholder\n  avatar: mp #默认头像设置 Gravatar style : mp, identicon, monsterid, wavatar, robohash, retro\n  pageSize: 10 # Pagination size\n  lang: zh-CN\n  visitor: true # Article reading statistic 这个要设置为false,以免与 leancloud_visitors 突冲 \n  NoRecordIP: false # Whether to record the commenter IP\n  serverURLs: # When the custom domain name is enabled, fill it in here (it will be detected automatically by default, no need to fill in)\n  powerMode: true\n  tagMeta:\n    visitor: 新朋友\n    master: 博主\n    friend: 小伙伴\n    investor: 金主粑粑\n  tagColor:\n    master: "var(--color-orange)"\n    friend: "var(--color-aqua)"\n    investor: "var(--color-pink)"\n  tagMember:\n    master:\n      # - hash of master@email.com\n      # - hash of master2@email.com\n    friend:\n      # - hash of friend@email.com\n      # - hash of friend2@email.com\n    investor:\n      # - hash of investor1@email.com\n
\n", "tags": [ "极空间", "Docker", @@ -135,7 +135,7 @@ "url": "https://blog.jingxiyuan.cn/2022/10/21/%E6%9E%81%E7%A9%BA%E9%97%B4Docker%E7%89%88mariadb%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/", "title": "极空间Docker版mariadb安装与配置", "date_published": "2022-10-21T01:06:00.000Z", - "content_html": "

# 介绍

\n\n

# 安装

\n\n

# 配置

\n\n
stream {\n\t\n\t#极空间-docker-mariadb\n\tupstream mariadb {\n\t\thash $remote_addr consistent;\n\t\tserver mariadb的ip:端口;\n\t}\n\n\tserver {\n\t\tlisten 监听端口;\n\n\t\tproxy_connect_timeout 30s;\n\t\tproxy_timeout 300s;\n\t\tproxy_pass mariadb;\n\t}\n    \n}\n
\n", + "content_html": "

# 介绍

\n\n

# 安装

\n\n

# 配置

\n\n
stream {\n\t\n\t#极空间-docker-mariadb\n\tupstream mariadb {\n\t\thash $remote_addr consistent;\n\t\tserver mariadb的ip:端口;\n\t}\n\n\tserver {\n\t\tlisten 监听端口;\n\n\t\tproxy_connect_timeout 30s;\n\t\tproxy_timeout 300s;\n\t\tproxy_pass mariadb;\n\t}\n    \n}\n
\n", "tags": [ "极空间", "Docker", @@ -189,7 +189,7 @@ "url": "https://blog.jingxiyuan.cn/2022/10/17/redis%E4%B8%BB%E4%BB%8E%E5%9F%BA%E7%A1%80%E9%85%8D%E7%BD%AE%E8%AE%B0%E5%BD%95/", "title": "redis主从基础配置", "date_published": "2022-10-17T06:07:00.000Z", - "content_html": "

# 主服务

\n
    \n
  1. 基础配置
  2. \n
\n
port 6379\nrequirepass 123456(密码,建议不设置)\nvm-enabled no (虚拟内存,内存够的情况下可以不使用)\nmaxmemory 1GB(告诉Redis当使用了多少物理内存后就开始拒绝后续的写入)\nbind 127.0.0.1 (注释掉,否则不能外部连接)\nrdbchecksum no(持久化数据检查)\nlist-max-ziplist-size 1024(ziplist的最大容量,正数为自己指定的大小。负数-1到-5为对应的值4到64Kb)\nlist-compress-depth 20(quicklist的两端多少个node不压缩,0为全部不压缩)\n
\n
sysctl vm.overcommit_memory=1 (立即生效)\n修改/etc/sysctl.conf添加vm.overcommit_memory=1(表示内核允许分配所有的物理内存,而不管当前的内存状态如何。Redis的RDB持久化实现是folk一个子进程,然后让子进程将内存镜像dump到RDB文件中。理论上来说是需要跟父进程一样的内存空间,但是由于linux很早就支持的copy-on-write技术,所以实际上并不需要这么多的物理内存的。)\n
\n
    \n
  1. 禁用透明大页(影响性能)
  2. \n
\n
需要sudo su 切换到root身份(sudo 没用)\necho never > /sys/kernel/mm/transparent_hugepage/enabled\n修改/etc/init.d/redis-server,加入/bin/echo never > /sys/kernel/mm/transparent_hugepage/enabled\n
\n
    \n
  1. 修复 TCP 警告
  2. \n
\n
sysctl net.core.somaxconn=1024(立即生效)\n修改/etc/sysctl.conf添加net.core.somaxconn=1024\n
\n
    \n
  1. 客户端缓冲区限制
  2. \n
\n
客户端的输出缓冲区的限制,因为某种原因客户端从服务器读取数据的速度不够快,可用于强制断开连接(一个常见的原因是一个发布 / 订阅客户端消费消息的速度无法赶上生产它们的速度)。\n可以三种不同客户端的方式进行设置:\nnormal ->  正常客户端\nslave  -> slave 和 MONITOR 客户端\npubsub ->  至少订阅了一个 pubsub channel 或 pattern 的客户端\n语法 :\nclient-output-buffer-limit <class><hard limit> <soft limit> <soft seconds>\n一旦达到硬限制客户端会立即断开,或者达到软限制并保持达成的指定秒数(连续)。\n例如,如果硬限制为 32 兆字节和软限制为 16 兆字节 /10 秒,客户端将会立即断开。如果输出缓冲区的大小达到 32 兆字节,客户端达到 16 兆字节和连续超过了限制 10 秒,也将断开连接。默认 normal 客户端不做限制,因为他们在一个请求后未要求时(以推的方式)不接收数据,\n只有异步客户端可能会出现请求数据的速度比它可以读取的速度快的场景。\n把硬限制和软限制都设置为 0 来禁用该特性\nclient-output-buffer-limit normal 0 0 0\nclient-output-buffer-limit slave 5gb 512mb 60\nclient-output-buffer-limit pubsub 32mb 8mb 60\n
\n
    \n
  1. 持久化配置
  2. \n
\n
---关闭RDB持久化---\nsave ""\n默认配置如下:\nsave 900 1 #900秒内有1次更新就持久化\nsave 300 10 #300秒内有10次更新就持久化\nsave 60 10000 #60秒内有10000次更新就持久化\n---关闭RDB持久化---\n主从同步支持两种策略,即disk和socket方式。\n新的slave端和重连的salve端不允许去继续同步进程,这被称之为“完全同步”。\n一个RDB文件从master端传到slave端,分为两种情况:\n1、支持disk:master端将RDB file写到disk,稍后再传送到slave端;\n2、无磁盘diskless:master端直接将RDB file传到slave socket,不需要与disk进行交互。无磁盘diskless方式适合磁盘读写速度慢但网络带宽非常高的环境。\nrepl-diskless-sync no 默认不使用diskless同步方式\nrepl-diskless-sync-delay 30 无磁盘diskless方式在进行数据传递之前会有一个时间的延迟,以便slave端能够进行到待传送的目标队列中,这个时间默认是5秒\nrepl-ping-slave-period 60 slave端向server端发送pings的时间区间设置,默认为10秒\nrepl-timeout 3600 设置超时时间\nrepl-disable-tcp-nodelay no 是否启用TCP_NODELAY,如果启用则会使用少量的TCP包和带宽去进行数据传输到slave端,当然速度会比较慢;如果不启用则传输速度比较快,但是会占用比较多的带宽。\nrepl-backlog-size 1mb 设置backlog的大小,backlog是一个缓冲区,在slave端失连时存放要同步到slave的数据,因此当一个slave要重连时,经常是不需要完全同步的,执行局部同步就足够了。\nbacklog设置的越大,slave可以失连的时间就越长。\nrepl-backlog-ttl 3600 如果一段时间后没有slave连接到master,则backlog size的内存将会被释放。如果值为0则表示永远不释放这部份内存。\nslave-priority 100 slave端的优先级设置,值是一个整数,数字越小表示优先级越高。当master故障时将会按照优先级来选择slave端进行恢复,如果值设置为0,则表示该slave永远不会被选择。\nmin-slaves-to-write 3\nmin-slaves-max-lag 10 设置当一个master端的可用slave少于N个,延迟时间大于M秒时,不接收写操作。\n
\n

# 从服务

\n
基本配置同主服务一致\nslaveof 127.0.0.1 6379(主redis的ip和端口)\nmasterauth 123456 (主redis的密码)\n可以通过slaveof no one命令将Slaver升级为Maste\nbgsave (持久化命令,在redis-cli中执行,默认创建dump.rdb文件,路径为 /var/lib/redis/dump.rdb。可通过find / -name dump.rd查找)\n
\n

# 相关命令

\n
看状态\nsudo /etc/init.d/redis-server status\n看端口\nnetstat -nlt|grep 6379\n外部连接\nsudo vim /etc/redis/redis.conf把protected-mode改为no,把bind ip注释掉\n重启\nsudo server redis-server restart\n查看内存\nfree -m\n批量删除指定key\nredis-cli -n 6 scan 0 match *2020-06-12 count 10000| xargs redis-cli -n 6 del\n大量删除key后快速释放被占用的内存\nmemory purge\n
\n

# 问题解决

\n
写入问题\nredis-cli config set stop-writes-on-bgsave-error no\nsudo vim /etc/redis/redis.conf把stop-writes-on-bgsave-error改为no\n修改系统 sudo vim /etc/sysctl.conf加入vm.overcommit_memory=1\nsudo sysctl vm.overcommit_memory=1\n
\n", + "content_html": "

# 主服务

\n
    \n
  1. 基础配置
  2. \n
\n
port 6379\nrequirepass 123456(密码,建议不设置)\nvm-enabled no (虚拟内存,内存够的情况下可以不使用)\nmaxmemory 1GB(告诉Redis当使用了多少物理内存后就开始拒绝后续的写入)\nbind 127.0.0.1 (注释掉,否则不能外部连接)\nrdbchecksum no(持久化数据检查)\nlist-max-ziplist-size 1024(ziplist的最大容量,正数为自己指定的大小。负数-1到-5为对应的值4到64Kb)\nlist-compress-depth 20(quicklist的两端多少个node不压缩,0为全部不压缩)\n
\n
sysctl vm.overcommit_memory=1 (立即生效)\n修改/etc/sysctl.conf添加vm.overcommit_memory=1(表示内核允许分配所有的物理内存,而不管当前的内存状态如何。Redis的RDB持久化实现是folk一个子进程,然后让子进程将内存镜像dump到RDB文件中。理论上来说是需要跟父进程一样的内存空间,但是由于linux很早就支持的copy-on-write技术,所以实际上并不需要这么多的物理内存的。)\n
\n
    \n
  1. 禁用透明大页(影响性能)
  2. \n
\n
需要sudo su 切换到root身份(sudo 没用)\necho never > /sys/kernel/mm/transparent_hugepage/enabled\n修改/etc/init.d/redis-server,加入/bin/echo never > /sys/kernel/mm/transparent_hugepage/enabled\n
\n
    \n
  1. 修复 TCP 警告
  2. \n
\n
sysctl net.core.somaxconn=1024(立即生效)\n修改/etc/sysctl.conf添加net.core.somaxconn=1024\n
\n
    \n
  1. 客户端缓冲区限制
  2. \n
\n
客户端的输出缓冲区的限制,因为某种原因客户端从服务器读取数据的速度不够快,可用于强制断开连接(一个常见的原因是一个发布 / 订阅客户端消费消息的速度无法赶上生产它们的速度)。\n可以三种不同客户端的方式进行设置:\nnormal ->  正常客户端\nslave  -> slave 和 MONITOR 客户端\npubsub ->  至少订阅了一个 pubsub channel 或 pattern 的客户端\n语法 :\nclient-output-buffer-limit <class><hard limit> <soft limit> <soft seconds>\n一旦达到硬限制客户端会立即断开,或者达到软限制并保持达成的指定秒数(连续)。\n例如,如果硬限制为 32 兆字节和软限制为 16 兆字节 /10 秒,客户端将会立即断开。如果输出缓冲区的大小达到 32 兆字节,客户端达到 16 兆字节和连续超过了限制 10 秒,也将断开连接。默认 normal 客户端不做限制,因为他们在一个请求后未要求时(以推的方式)不接收数据,\n只有异步客户端可能会出现请求数据的速度比它可以读取的速度快的场景。\n把硬限制和软限制都设置为 0 来禁用该特性\nclient-output-buffer-limit normal 0 0 0\nclient-output-buffer-limit slave 5gb 512mb 60\nclient-output-buffer-limit pubsub 32mb 8mb 60\n
\n
    \n
  1. 持久化配置
  2. \n
\n
---关闭RDB持久化---\nsave ""\n默认配置如下:\nsave 900 1 #900秒内有1次更新就持久化\nsave 300 10 #300秒内有10次更新就持久化\nsave 60 10000 #60秒内有10000次更新就持久化\n---关闭RDB持久化---\n主从同步支持两种策略,即disk和socket方式。\n新的slave端和重连的salve端不允许去继续同步进程,这被称之为“完全同步”。\n一个RDB文件从master端传到slave端,分为两种情况:\n1、支持disk:master端将RDB file写到disk,稍后再传送到slave端;\n2、无磁盘diskless:master端直接将RDB file传到slave socket,不需要与disk进行交互。无磁盘diskless方式适合磁盘读写速度慢但网络带宽非常高的环境。\nrepl-diskless-sync no 默认不使用diskless同步方式\nrepl-diskless-sync-delay 30 无磁盘diskless方式在进行数据传递之前会有一个时间的延迟,以便slave端能够进行到待传送的目标队列中,这个时间默认是5秒\nrepl-ping-slave-period 60 slave端向server端发送pings的时间区间设置,默认为10秒\nrepl-timeout 3600 设置超时时间\nrepl-disable-tcp-nodelay no 是否启用TCP_NODELAY,如果启用则会使用少量的TCP包和带宽去进行数据传输到slave端,当然速度会比较慢;如果不启用则传输速度比较快,但是会占用比较多的带宽。\nrepl-backlog-size 1mb 设置backlog的大小,backlog是一个缓冲区,在slave端失连时存放要同步到slave的数据,因此当一个slave要重连时,经常是不需要完全同步的,执行局部同步就足够了。\nbacklog设置的越大,slave可以失连的时间就越长。\nrepl-backlog-ttl 3600 如果一段时间后没有slave连接到master,则backlog size的内存将会被释放。如果值为0则表示永远不释放这部份内存。\nslave-priority 100 slave端的优先级设置,值是一个整数,数字越小表示优先级越高。当master故障时将会按照优先级来选择slave端进行恢复,如果值设置为0,则表示该slave永远不会被选择。\nmin-slaves-to-write 3\nmin-slaves-max-lag 10 设置当一个master端的可用slave少于N个,延迟时间大于M秒时,不接收写操作。\n
\n

# 从服务

\n
基本配置同主服务一致\nslaveof 127.0.0.1 6379(主redis的ip和端口)\nmasterauth 123456 (主redis的密码)\n可以通过slaveof no one命令将Slaver升级为Maste\nbgsave (持久化命令,在redis-cli中执行,默认创建dump.rdb文件,路径为 /var/lib/redis/dump.rdb。可通过find / -name dump.rd查找)\n
\n

# 相关命令

\n
看状态\nsudo /etc/init.d/redis-server status\n看端口\nnetstat -nlt|grep 6379\n外部连接\nsudo vim /etc/redis/redis.conf把protected-mode改为no,把bind ip注释掉\n重启\nsudo server redis-server restart\n查看内存\nfree -m\n批量删除指定key\nredis-cli -n 6 scan 0 match *2020-06-12 count 10000| xargs redis-cli -n 6 del\n大量删除key后快速释放被占用的内存\nmemory purge\n
\n

# 问题解决

\n
写入问题\nredis-cli config set stop-writes-on-bgsave-error no\nsudo vim /etc/redis/redis.conf把stop-writes-on-bgsave-error改为no\n修改系统 sudo vim /etc/sysctl.conf加入vm.overcommit_memory=1\nsudo sysctl vm.overcommit_memory=1\n
\n", "tags": [ "Linux", "服务", @@ -201,7 +201,7 @@ "url": "https://blog.jingxiyuan.cn/2022/10/14/nginx%E5%85%81%E8%AE%B8%E8%B7%A8%E5%9F%9F%E8%8E%B7%E5%8F%96cookies%E6%96%B9%E6%B3%95/", "title": "nginx允许跨域获取cookie的方法", "date_published": "2022-10-14T09:13:00.000Z", - "content_html": "

# 使用场景

\n

  在 A 域名的页面向 B 域名提交数据时需要代入 B 域名的 cookie,否则 B 域名会跳转到登陆页面。解决方式需要使用到 nginx 反向代理,配置如下:

\n
server {\n\tlisten port ssl http2;\n\tserver_name xxx.com;\n\tssl_certificate_key /xxx.key;\n\tssl_certificate /xxx.pem;\n\tproxy_cookie_path ~(.*) "$1; SameSite=None; secure; httponly";\n\n\tlocation / {\n\t\t#允许镶套的方式(可以同域镶套、指定域名镶套或者所有域名镶套)\n\t\tadd_header X-Frame-Options ALLOWALL; #允许被所有域名镶套\n\t\tproxy_pass http://xxx;\n\t}\n}\n
\n", + "content_html": "

# 使用场景

\n

  在 A 域名的页面向 B 域名提交数据时需要代入 B 域名的 cookie,否则 B 域名会跳转到登陆页面。解决方式需要使用到 nginx 反向代理,配置如下:

\n
server {\n\tlisten port ssl http2;\n\tserver_name xxx.com;\n\tssl_certificate_key /xxx.key;\n\tssl_certificate /xxx.pem;\n\tproxy_cookie_path ~(.*) "$1; SameSite=None; secure; httponly";\n\n\tlocation / {\n\t\t#允许镶套的方式(可以同域镶套、指定域名镶套或者所有域名镶套)\n\t\tadd_header X-Frame-Options ALLOWALL; #允许被所有域名镶套\n\t\tproxy_pass http://xxx;\n\t}\n}\n
\n", "tags": [ "Linux", "服务", @@ -269,7 +269,7 @@ "url": "https://blog.jingxiyuan.cn/2022/09/27/nginx%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E9%85%8D%E7%BD%AE/", "title": "nginx负载均衡配置", "date_published": "2022-09-27T06:45:00.000Z", - "content_html": "

# nginx 负载均衡配置

\n
    \n
  1. 轮询(默认)
  2. \n
\n

  每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。

\n
upstream my_server {\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\n
\n
    \n
  1. weight 权重策略
  2. \n
\n

  weight 代表权重,默认为 1,权重越高被分配的客户端越多,指定轮询几率。weight 和访问比率成正比,用于后端服务器性能不均的情况。

\n
upstream my_server {\n\tserver 192.168.0.2:8080 weight=1;\n\tserver 192.168.0.3:8080 weight=2;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\n
\n
    \n
  1. ip_hash
  2. \n
\n

  每个请求按访问 ip 的 hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决 session 的问题。

\n
upstream my_server {\n\tip_hash;\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\n
\n
    \n
  1. fair (第三方)
  2. \n
\n

  按后端服务器的响应时间来分配请求,响应时间短的优先分配。

\n
upstream my_server {\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n\tfair;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\n
\n
    \n
  1. 动静分离
  2. \n
\n

  把静态的资源,比如图片,css,js 等先加载到 Nginx 的服务器里。

\n", + "content_html": "

# nginx 负载均衡配置

\n
    \n
  1. 轮询(默认)
  2. \n
\n

  每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。

\n
upstream my_server {\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\n
\n
    \n
  1. weight 权重策略
  2. \n
\n

  weight 代表权重,默认为 1,权重越高被分配的客户端越多,指定轮询几率。weight 和访问比率成正比,用于后端服务器性能不均的情况。

\n
upstream my_server {\n\tserver 192.168.0.2:8080 weight=1;\n\tserver 192.168.0.3:8080 weight=2;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\n
\n
    \n
  1. ip_hash
  2. \n
\n

  每个请求按访问 ip 的 hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决 session 的问题。

\n
upstream my_server {\n\tip_hash;\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\n
\n
    \n
  1. fair (第三方)
  2. \n
\n

  按后端服务器的响应时间来分配请求,响应时间短的优先分配。

\n
upstream my_server {\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n\tfair;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\n
\n
    \n
  1. 动静分离
  2. \n
\n

  把静态的资源,比如图片,css,js 等先加载到 Nginx 的服务器里。

\n", "tags": [ "Linux", "服务", diff --git a/index.html b/index.html index a57935e9d..52d9bf173 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

文章列表

6.1k 6 分钟

# 引言 所有配置方法和介绍均来至于网络搜索汇总,主要用于方便后期巩固学习。 # 何为反向代理 在介绍反向代理之前,先来了解一下正向代理。 __正向代理:__如果把局域网外的 Internet 想象成一个巨大的资源库,则局域网中的客户端要访问...
1.6k 1 分钟

# 描述 今天需要把一个 web 项目部署到 ubuntu 服务器上,结果直接使用 apt install nodejs 安装的 nodejs 版本过低,导致编译失败。最后通过查看官网文档获取到了 ubuntu 最新 nodejs 的安装命令。 # 过程 卸载旧的 nodejs(此命令会卸载掉相关依赖包) sudo apt autoremove --purge nodejs 安装 NodeJS curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - &amp;&amp; sudo...
1.1k 1 分钟

# 区别: 2&gt;/dev/null 意思就是把错误输出到 “黑洞” &gt;/dev/null 2&gt;&amp;1 默认情况是 1,也就是等同于 1&gt;/dev/null 2&gt;&amp;1。意思就是把标准输出重定向到 “黑洞”,还把错误输出 2 重定向到标准输出 1,也就是标准输出和错误输出都进了 “黑洞” 2&gt;&amp;1 &gt;/dev/null 意思就是把错误输出 2 重定向到标准出书 1,也就是屏幕,标准输出进了 “黑洞”,也就是标准输出进了黑洞,错误输出打印到屏幕 #...
68 1 分钟

# 360 独立版小工具 360 全家桶众说纷纭但工具箱还是挺实用的,这波小工具可以单独下载使用,有需要的朋友赶紧下载吧! 下载地址 # 部分工具截图
115 1 分钟

# 介绍 当你经常需要在家远程到公司进行办公,或者开启了很多临时文件、文档、软件需要等到第二天继续之前的工作时,结果系统自行更新并重启了。是不是会让你非常郁闷。关闭系统自行更新就可以轻松解决此类问题。 # 下载 win10 / win11 / 本地
2.4k 2 分钟

# 介绍 ip 直连一般都映射了 5055, 但是直接访问 5055 极空间只提供了 http 协议,如果希望使用 https 协议则必须使用其它端口进行访问。以下方案采用 nginx 反向代理实现,端口使用 10000 举例。 # 配置 需要先把 10000 端口在路由器上做好映射。 证书生成好并放置到 nginx 上。(证书生成方法不做介绍请自行百度) http 跳转 https 配置 server &#123; if ($scheme = http) &#123; rewrite ^(.*)$ https://$host$1...
2.3k 2 分钟

# 介绍 青龙面板是一个支持 python3、javascript、shell、typescript 的定时任务管理面板。它支持在线管理脚本、环境变量、配置文件,支持在线查看日志及支持多种方式的消息通知。 # 安装 本文使用的是 whyour/qinglong 的镜像。 路径映射(由于青龙面板有 nodejs 环境,所以我把 hexo 博客的编译也放置在上面,再把 nginx 的 html 映射过来,这样就可以直接编译发布了。) #青龙面板装载路径 /ql/data #博客装载路径(如果你不部署hexo博客可以不用配置) /root/.ssh...
959 1 分钟

valine 评论需要 LeanCloud 支持 # LeanCloud 注册 到 LeanCloud 网站完成注册。 创建应用。 名称随便取,方案看自己选择。开发版免费但是有限制,商业版收费无限制。 点击配置按钮进行配置。 点击设置 - 应用凭证可获取 App ID 和 App Key 点击设置 - 安全中心根据自己的需求配置 # 修改 Theme.Shoka 配置 valine:  appId: 粘贴5中获取的App ID #Your_appId appKey: 粘贴5中获取的App Key #Your_appkey placeholder: ヽ(○´∀`)ノ♪欢迎畅所欲言...
406 1 分钟

# 介绍 mariadb 属于 mysql 的一个分支,完全兼容 mysql,使用方式和 mysql 无区别。 # 安装 本文介绍安装的镜像为 linuxserver_mariadb 的 10.5.13-r0-ls45,原则上使用最新版即可 配置文件映射 端口 环境(MYSQL_ROOT_PASSWORD 为数据库 root 用户密码) 到此已经可以在内网使用了,连接方法同 mysql 一致 # 配置 此处配置为 nginx 反向代理,配置完成后可在外网连接访问 stream &#123; #极空间-docker-mariadb upstream...
\ No newline at end of file +☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣

文章列表

6.1k 6 分钟

# 引言 所有配置方法和介绍均来至于网络搜索汇总,主要用于方便后期巩固学习。 # 何为反向代理 在介绍反向代理之前,先来了解一下正向代理。 __正向代理:__如果把局域网外的 Internet 想象成一个巨大的资源库,则局域网中的客户端要访问...
1.6k 1 分钟

# 描述 今天需要把一个 web 项目部署到 ubuntu 服务器上,结果直接使用 apt install nodejs 安装的 nodejs 版本过低,导致编译失败。最后通过查看官网文档获取到了 ubuntu 最新 nodejs 的安装命令。 # 过程 卸载旧的 nodejs(此命令会卸载掉相关依赖包) sudo apt autoremove --purge nodejs 安装 NodeJS curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - &amp;&amp; sudo...
1.1k 1 分钟

# 区别: 2&gt;/dev/null 意思就是把错误输出到 “黑洞” &gt;/dev/null 2&gt;&amp;1 默认情况是 1,也就是等同于 1&gt;/dev/null 2&gt;&amp;1。意思就是把标准输出重定向到 “黑洞”,还把错误输出 2 重定向到标准输出 1,也就是标准输出和错误输出都进了 “黑洞” 2&gt;&amp;1 &gt;/dev/null 意思就是把错误输出 2 重定向到标准出书 1,也就是屏幕,标准输出进了 “黑洞”,也就是标准输出进了黑洞,错误输出打印到屏幕 #...
68 1 分钟

# 360 独立版小工具 360 全家桶众说纷纭但工具箱还是挺实用的,这波小工具可以单独下载使用,有需要的朋友赶紧下载吧! 下载地址 # 部分工具截图
115 1 分钟

# 介绍 当你经常需要在家远程到公司进行办公,或者开启了很多临时文件、文档、软件需要等到第二天继续之前的工作时,结果系统自行更新并重启了。是不是会让你非常郁闷。关闭系统自行更新就可以轻松解决此类问题。 # 下载 win10 / win11 / 本地
2.4k 2 分钟

# 介绍 ip 直连一般都映射了 5055, 但是直接访问 5055 极空间只提供了 http 协议,如果希望使用 https 协议则必须使用其它端口进行访问。以下方案采用 nginx 反向代理实现,端口使用 10000 举例。 # 配置 需要先把 10000 端口在路由器上做好映射。 证书生成好并放置到 nginx 上。(证书生成方法不做介绍请自行百度) http 跳转 https 配置 server &#123; if ($scheme = http) &#123; rewrite ^(.*)$ https://$host$1...
2.3k 2 分钟

# 介绍 青龙面板是一个支持 python3、javascript、shell、typescript 的定时任务管理面板。它支持在线管理脚本、环境变量、配置文件,支持在线查看日志及支持多种方式的消息通知。 # 安装 本文使用的是 whyour/qinglong 的镜像。 路径映射(由于青龙面板有 nodejs 环境,所以我把 hexo 博客的编译也放置在上面,再把 nginx 的 html 映射过来,这样就可以直接编译发布了。) #青龙面板装载路径 /ql/data #博客装载路径(如果你不部署hexo博客可以不用配置) /root/.ssh...
959 1 分钟

valine 评论需要 LeanCloud 支持 # LeanCloud 注册 到 LeanCloud 网站完成注册。 创建应用。 名称随便取,方案看自己选择。开发版免费但是有限制,商业版收费无限制。 点击配置按钮进行配置。 点击设置 - 应用凭证可获取 App ID 和 App Key 点击设置 - 安全中心根据自己的需求配置 # 修改 Theme.Shoka 配置 valine:  appId: 粘贴5中获取的App ID #Your_appId appKey: 粘贴5中获取的App Key #Your_appkey placeholder: ヽ(○´∀`)ノ♪欢迎畅所欲言...
406 1 分钟

# 介绍 mariadb 属于 mysql 的一个分支,完全兼容 mysql,使用方式和 mysql 无区别。 # 安装 本文介绍安装的镜像为 linuxserver_mariadb 的 10.5.13-r0-ls45,原则上使用最新版即可 配置文件映射 端口 环境(MYSQL_ROOT_PASSWORD 为数据库 root 用户密码) 到此已经可以在内网使用了,连接方法同 mysql 一致 # 配置 此处配置为 nginx 反向代理,配置完成后可在外网连接访问 stream &#123; #极空间-docker-mariadb upstream...
\ No newline at end of file diff --git a/page/2/index.html b/page/2/index.html index edea89faf..f0bfbc7f8 100644 --- a/page/2/index.html +++ b/page/2/index.html @@ -1 +1 @@ -☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
1.2k 1 分钟

# 安装 下载最新版 wordpress 镜像,如极空间无法下载,可到 passerma 网站下载。 需要先在 mysql 中创建给 wordpress 使用的库。 文件路径映射(目前极空间不能映射到高速盘,否则无法启动)。 端口映射。 通过映射的端口访问安装界面(一定要通过最终访问的页面进行安装,否则修改配置比较麻烦。如最终是域名访问,就先把域名解析代理等先配置好,再通过域名访问安装)。 # 配置 如需使用 https 访问,需要在 wp-config.php 中加入以下代码,否则资源文件无法访问。 if((!empty(...
101 1 分钟

一年一次的总结时间又到了,这一年前半年平平无奇,后半年惊涛骇浪。中年危机如期而遇,人身的低谷终究还是来了。很沮丧也很无助,但还是要坚强面对。人生起起伏伏,时好时坏,终归还是会好起来的。加油!加油!加油 !
7.3k 7 分钟

# 监控端服务安装与配置 nagios 需要安装主程序 core 和 nrpe(nagios 和各被监控主机都必须安装)。如需使用自研前端可通过安装 ndoutils (用于把 nagios 监控信息写入数据库) 和 mysql 实现。具体安装见官网 nagios 默认监控命令脚本放置在 libexec 中,自定义脚本也放到此处 etc/objects/commands.cfg 用于保存 nagios 默认监控命令 etc/nrpe.cfg 文件中需要添加用于被监控执行命令项(各被监控主机中都需要添加) etc/objects/hosts...
3.2k 3 分钟

# 主服务 基础配置 port 6379 requirepass 123456(密码,建议不设置) vm-enabled no (虚拟内存,内存够的情况下可以不使用) maxmemory 1GB(告诉Redis当使用了多少物理内存后就开始拒绝后续的写入) bind 127.0.0.1 (注释掉,否则不能外部连接) rdbchecksum no(持久化数据检查) list-max-ziplist-size 1024(ziplist的最大容量,正数为自己指定的大小。负数-1到-5为对应的值4到64Kb) list-compress-depth...
366 1 分钟

# 使用场景   在 A 域名的页面向 B 域名提交数据时需要代入 B 域名的 cookie,否则 B 域名会跳转到登陆页面。解决方式需要使用到 nginx 反向代理,配置如下: server &#123; listen port ssl http2; server_name xxx.com; ssl_certificate_key /xxx.key; ssl_certificate /xxx.pem; proxy_cookie_path ~(.*) &quot;$1; SameSite=None; secure;...
111 1 分钟

# 简介 PicGo 是一款开源的图床管理工具,十分流行。 PicGo 官方指南:PicGo | PicGo # 配置 安装插件(需要先安装 NodeJS) 图床配置   url 后缀必须用红线圈中的部分,key 在 chevereto 登陆后 api 配置中查找
709 1 分钟

# 前期准备   首先安装好 svn 和 git 工具。 # svn 转 git 1、 到 svn 项目目录右键选中 gitbash 打开窗口,执行获取用户并映射成 git 样式账号命令如下: svn log -q | awk -F '|' '/^r/ &#123;sub(&quot;^ &quot;, &quot;&quot;, $2); sub(&quot; $&quot;, &quot;&quot;, $2); print $2&quot; =...
1.6k 1 分钟

# X-Frame-Options 响应头配置详解   X-Frame-Options HTTP 响应头是用来给浏览器指示允许一个页面可否在,或者 中展现的标记。网站可以使用此功能,来确保自己网站的内容没有被嵌套到别人的网站中去,也从而避免了点击劫持 (clickjacking) 的攻击。 X-Frame-Options 三个参数: 1、 DENY   表示该页面不允许在 frame 中展示,即便是在相同域名的页面中嵌套也不允许。 2、SAMEORIGIN   表示该页面可以在相同域名页面的 frame 中展示。 3、ALLOW-FROM uri   表示该页面可以在指定来源的 frame...
1.1k 1 分钟

# nginx 负载均衡配置 轮询(默认)   每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。 upstream my_server &#123; server 192.168.0.2:8080; server 192.168.0.3:8080; &#125; server &#123; listen 80; server_name 192.168.0.1; # Path to the root of your installation location / &#123; proxy_pass...
\ No newline at end of file +☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
1.2k 1 分钟

# 安装 下载最新版 wordpress 镜像,如极空间无法下载,可到 passerma 网站下载。 需要先在 mysql 中创建给 wordpress 使用的库。 文件路径映射(目前极空间不能映射到高速盘,否则无法启动)。 端口映射。 通过映射的端口访问安装界面(一定要通过最终访问的页面进行安装,否则修改配置比较麻烦。如最终是域名访问,就先把域名解析代理等先配置好,再通过域名访问安装)。 # 配置 如需使用 https 访问,需要在 wp-config.php 中加入以下代码,否则资源文件无法访问。 if((!empty(...
101 1 分钟

一年一次的总结时间又到了,这一年前半年平平无奇,后半年惊涛骇浪。中年危机如期而遇,人身的低谷终究还是来了。很沮丧也很无助,但还是要坚强面对。人生起起伏伏,时好时坏,终归还是会好起来的。加油!加油!加油 !
7.3k 7 分钟

# 监控端服务安装与配置 nagios 需要安装主程序 core 和 nrpe(nagios 和各被监控主机都必须安装)。如需使用自研前端可通过安装 ndoutils (用于把 nagios 监控信息写入数据库) 和 mysql 实现。具体安装见官网 nagios 默认监控命令脚本放置在 libexec 中,自定义脚本也放到此处 etc/objects/commands.cfg 用于保存 nagios 默认监控命令 etc/nrpe.cfg 文件中需要添加用于被监控执行命令项(各被监控主机中都需要添加) etc/objects/hosts...
3.2k 3 分钟

# 主服务 基础配置 port 6379 requirepass 123456(密码,建议不设置) vm-enabled no (虚拟内存,内存够的情况下可以不使用) maxmemory 1GB(告诉Redis当使用了多少物理内存后就开始拒绝后续的写入) bind 127.0.0.1 (注释掉,否则不能外部连接) rdbchecksum no(持久化数据检查) list-max-ziplist-size 1024(ziplist的最大容量,正数为自己指定的大小。负数-1到-5为对应的值4到64Kb) list-compress-depth...
366 1 分钟

# 使用场景   在 A 域名的页面向 B 域名提交数据时需要代入 B 域名的 cookie,否则 B 域名会跳转到登陆页面。解决方式需要使用到 nginx 反向代理,配置如下: server &#123; listen port ssl http2; server_name xxx.com; ssl_certificate_key /xxx.key; ssl_certificate /xxx.pem; proxy_cookie_path ~(.*) &quot;$1; SameSite=None; secure;...
111 1 分钟

# 简介 PicGo 是一款开源的图床管理工具,十分流行。 PicGo 官方指南:PicGo | PicGo # 配置 安装插件(需要先安装 NodeJS) 图床配置   url 后缀必须用红线圈中的部分,key 在 chevereto 登陆后 api 配置中查找
709 1 分钟

# 前期准备   首先安装好 svn 和 git 工具。 # svn 转 git 1、 到 svn 项目目录右键选中 gitbash 打开窗口,执行获取用户并映射成 git 样式账号命令如下: svn log -q | awk -F '|' '/^r/ &#123;sub(&quot;^ &quot;, &quot;&quot;, $2); sub(&quot; $&quot;, &quot;&quot;, $2); print $2&quot; =...
1.6k 1 分钟

# X-Frame-Options 响应头配置详解   X-Frame-Options HTTP 响应头是用来给浏览器指示允许一个页面可否在,或者 中展现的标记。网站可以使用此功能,来确保自己网站的内容没有被嵌套到别人的网站中去,也从而避免了点击劫持 (clickjacking) 的攻击。 X-Frame-Options 三个参数: 1、 DENY   表示该页面不允许在 frame 中展示,即便是在相同域名的页面中嵌套也不允许。 2、SAMEORIGIN   表示该页面可以在相同域名页面的 frame 中展示。 3、ALLOW-FROM uri   表示该页面可以在指定来源的 frame...
1.1k 1 分钟

# nginx 负载均衡配置 轮询(默认)   每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。 upstream my_server &#123; server 192.168.0.2:8080; server 192.168.0.3:8080; &#125; server &#123; listen 80; server_name 192.168.0.1; # Path to the root of your installation location / &#123; proxy_pass...
\ No newline at end of file diff --git a/page/3/index.html b/page/3/index.html index 2b97ee4ef..cc86e34cb 100644 --- a/page/3/index.html +++ b/page/3/index.html @@ -1 +1 @@ -☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
1.8k 2 分钟

今天突然发现博客的音乐无法播放了。经过一顿查找,发现是因为 https://api.i-meto.com/meting/api 调用出错了。shoka 主题应该是通过这个网站提取音乐地址、图片等信息。通过断点发现网易播放列表还是能正常获取的,只是列表中的具体音乐、图片无法获取了。于是自己用获取的列表信息组装出正确的 url 问题基本解决。只针对网易播放列表,图片只能使用一张固定的。   解决方法如下:     到 themes\shoka\source\js_app 目录下打开 player.js 文件,在最底部 init (config) 下加入 vendorJs...
268 1 分钟

今天突然发现自己的网站不能访问了。经过一顿排查,发现是家里的外网 ip 变动后 nginx 解析的域名 ip 还是旧 ip 导致的。手动重启 nginx 后恢复正常。但这不是长久之计,如果每次 ip 变动都需要重启一次 nginx,想想都头大。于是查询资料后获得了解决办法,方法如下: location / &#123; resolver 114.114.114.114 valid=60s; #自定义缓存有效时间间隔对变量中的域名进行解析 set $my_server &quot;https://ip:port&quot;; proxy_pass...
179 1 分钟

# 下载工具 protoc-3.19.5-win64.zip # 生成 js 文件 把 xxx.proto 文件拷贝到解压的 protoc-3.19.5-win64\bin 目录下 cmd 到相同的 bin 目录下 执行 protoc.exe --js_out=import_style=commonjs,binary:. ./xxx.proto 命令,就会在 bin 目录下生成 xxx_pb.js 文件
508 1 分钟

今天前端开发跟我反馈用 vue 的 socketio 连接不上后台服务,连接无反应无任何报错。所以不清楚是前端代码问题还是后台服务的问题。由于框架为另一同事搭建,我只负责处理后端业务逻辑部分,所以第一时间我也不清楚具体的原因。于是我找了个第三方的 socket 工具尝试连接,果然有问题。但是只是提示连接不上,无明显错误原因。到后台查看发现有提示 Unknown transport for request 错误,最后通过调试发现 netty-socketio 的库中 AuthorizeHandler 类有段处理 transport 的代码只能接受大写的 WEBSOCKET 或者...
598 1 分钟

# Hexo + Theme.Shoka 安装   安装介绍 # algolia 注册 algolia 不支持国内邮箱注册,而 google 和 github 由于国内被墙也没法使用。所以只能先注册 netlify 然后通过 netlify 注册 algolia。 登录 algolia 后创建一个 index,名字随意记住既可。 点击右上角红点,弹出窗口点 settings 按钮。 点击 API KEYS,获取 appId 和 adminApiKey 填入 hexo 的_config.yml 中 apiKey 暂时不填。 algolia: appId: #Your...
608 1 分钟

# 安装准备 需要先安装好 mysql 数据库 选择版本,1.5 版以前支持中文,之后被维护的团队删除只支持英文 本文介绍使用的是 linuxserver_chevereto 的镜像 需要预先创建好给 chevereto 使用的库、账户、密码 经过测试,使用 surenkid_chevereto 的镜像可以完美支持多国语言,配置同 linuxserver_chevereto 一样 # 容器配置 映射路径(不要放在高速盘,否则会有权限问题) 端口 环境(puid 和 pgid 使用 1000,不要使用 0,否则会报错) # 初始化配置 使用 http:// 极空间...
1.1k 1 分钟

# hexo 博客安装 安装 nodejs 安装 git 安装 hexo(windows 需进入 git bash) npm install -g hexo-cli 初始化博客目录 hexo init blog 进入博客目录 cd blog 初始化 hexo 到博客目录 npm install # shoka 主题安装 下载主题 git clone https://github.com/amehime/hexo-theme-shoka.git ./themes/shoka 卸载 hexo-renderer-marked 以及别的 markdown 文件渲染器 npm un...
\ No newline at end of file +☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
1.8k 2 分钟

今天突然发现博客的音乐无法播放了。经过一顿查找,发现是因为 https://api.i-meto.com/meting/api 调用出错了。shoka 主题应该是通过这个网站提取音乐地址、图片等信息。通过断点发现网易播放列表还是能正常获取的,只是列表中的具体音乐、图片无法获取了。于是自己用获取的列表信息组装出正确的 url 问题基本解决。只针对网易播放列表,图片只能使用一张固定的。   解决方法如下:     到 themes\shoka\source\js_app 目录下打开 player.js 文件,在最底部 init (config) 下加入 vendorJs...
268 1 分钟

今天突然发现自己的网站不能访问了。经过一顿排查,发现是家里的外网 ip 变动后 nginx 解析的域名 ip 还是旧 ip 导致的。手动重启 nginx 后恢复正常。但这不是长久之计,如果每次 ip 变动都需要重启一次 nginx,想想都头大。于是查询资料后获得了解决办法,方法如下: location / &#123; resolver 114.114.114.114 valid=60s; #自定义缓存有效时间间隔对变量中的域名进行解析 set $my_server &quot;https://ip:port&quot;; proxy_pass...
179 1 分钟

# 下载工具 protoc-3.19.5-win64.zip # 生成 js 文件 把 xxx.proto 文件拷贝到解压的 protoc-3.19.5-win64\bin 目录下 cmd 到相同的 bin 目录下 执行 protoc.exe --js_out=import_style=commonjs,binary:. ./xxx.proto 命令,就会在 bin 目录下生成 xxx_pb.js 文件
508 1 分钟

今天前端开发跟我反馈用 vue 的 socketio 连接不上后台服务,连接无反应无任何报错。所以不清楚是前端代码问题还是后台服务的问题。由于框架为另一同事搭建,我只负责处理后端业务逻辑部分,所以第一时间我也不清楚具体的原因。于是我找了个第三方的 socket 工具尝试连接,果然有问题。但是只是提示连接不上,无明显错误原因。到后台查看发现有提示 Unknown transport for request 错误,最后通过调试发现 netty-socketio 的库中 AuthorizeHandler 类有段处理 transport 的代码只能接受大写的 WEBSOCKET 或者...
598 1 分钟

# Hexo + Theme.Shoka 安装   安装介绍 # algolia 注册 algolia 不支持国内邮箱注册,而 google 和 github 由于国内被墙也没法使用。所以只能先注册 netlify 然后通过 netlify 注册 algolia。 登录 algolia 后创建一个 index,名字随意记住既可。 点击右上角红点,弹出窗口点 settings 按钮。 点击 API KEYS,获取 appId 和 adminApiKey 填入 hexo 的_config.yml 中 apiKey 暂时不填。 algolia: appId: #Your...
608 1 分钟

# 安装准备 需要先安装好 mysql 数据库 选择版本,1.5 版以前支持中文,之后被维护的团队删除只支持英文 本文介绍使用的是 linuxserver_chevereto 的镜像 需要预先创建好给 chevereto 使用的库、账户、密码 经过测试,使用 surenkid_chevereto 的镜像可以完美支持多国语言,配置同 linuxserver_chevereto 一样 # 容器配置 映射路径(不要放在高速盘,否则会有权限问题) 端口 环境(puid 和 pgid 使用 1000,不要使用 0,否则会报错) # 初始化配置 使用 http:// 极空间...
1.1k 1 分钟

# hexo 博客安装 安装 nodejs 安装 git 安装 hexo(windows 需进入 git bash) npm install -g hexo-cli 初始化博客目录 hexo init blog 进入博客目录 cd blog 初始化 hexo 到博客目录 npm install # shoka 主题安装 下载主题 git clone https://github.com/amehime/hexo-theme-shoka.git ./themes/shoka 卸载 hexo-renderer-marked 以及别的 markdown 文件渲染器 npm un...
\ No newline at end of file diff --git a/rss.xml b/rss.xml index 1f9db6a8a..4a5cb1680 100644 --- a/rss.xml +++ b/rss.xml @@ -57,18 +57,51 @@ __反向代理:__看下面原理图,就一目了然。其实客户端对代 <p>配置文件中有很多 #号,该符号表示注释内容,去掉所有以 #开头的段落,精简之后的配置文件内容如下(PS:其实注释掉的地方,都是一些功能的使用代码,需要用到的时候,取消注释即可):</p> </li> </ul> -<figure class="highlight xml"><figcaption data-lang="XML"></figcaption><table><tr><td data-num="1"></td><td><pre># 主进程叫master,负责管理子进程,子进程叫worker</pre></td></tr><tr><td data-num="2"></td><td><pre># worker_processes配置项表示开启几个业务进程,一般和cpu核数有关</pre></td></tr><tr><td data-num="3"></td><td><pre>worker_processes 1;</pre></td></tr><tr><td data-num="4"></td><td><pre></pre></td></tr><tr><td data-num="5"></td><td><pre>events &#123;</pre></td></tr><tr><td data-num="6"></td><td><pre> worker_connections 1024;</pre></td></tr><tr><td data-num="7"></td><td><pre>&#125;</pre></td></tr><tr><td data-num="8"></td><td><pre></pre></td></tr><tr><td data-num="9"></td><td><pre>http &#123;</pre></td></tr><tr><td data-num="10"></td><td><pre> # include表示可以引入其他文件,此处表示引入http mime类型</pre></td></tr><tr><td data-num="11"></td><td><pre> include mime.types;</pre></td></tr><tr><td data-num="12"></td><td><pre> default_type application/octet-stream;</pre></td></tr><tr><td data-num="13"></td><td><pre> sendfile on;</pre></td></tr><tr><td data-num="14"></td><td><pre> keepalive_timeout 65;</pre></td></tr><tr><td data-num="15"></td><td><pre></pre></td></tr><tr><td data-num="16"></td><td><pre> # 虚拟主机,可以配置多个</pre></td></tr><tr><td data-num="17"></td><td><pre> server &#123;</pre></td></tr><tr><td data-num="18"></td><td><pre> listen 80;</pre></td></tr><tr><td data-num="19"></td><td><pre> server_name localhost;</pre></td></tr><tr><td data-num="20"></td><td><pre></pre></td></tr><tr><td data-num="21"></td><td><pre> location / &#123;</pre></td></tr><tr><td data-num="22"></td><td><pre> # 路径匹配之后,哪个目录下去匹配相应的网页,html是相对路径</pre></td></tr><tr><td data-num="23"></td><td><pre> root html;</pre></td></tr><tr><td data-num="24"></td><td><pre> index index.html index.htm;</pre></td></tr><tr><td data-num="25"></td><td><pre> &#125;</pre></td></tr><tr><td data-num="26"></td><td><pre></pre></td></tr><tr><td data-num="27"></td><td><pre> error_page 500 502 503 504 /50x.html;</pre></td></tr><tr><td data-num="28"></td><td><pre> location = /50x.html &#123;</pre></td></tr><tr><td data-num="29"></td><td><pre> root html;</pre></td></tr><tr><td data-num="30"></td><td><pre> &#125;</pre></td></tr><tr><td data-num="31"></td><td><pre> &#125;</pre></td></tr><tr><td data-num="32"></td><td><pre>&#125;</pre></td></tr></table></figure><p>去掉注释信息后,可以将 nginx.conf 配置文件分为三部分:</p> +<pre><code class="language-yaml"># 主进程叫master,负责管理子进程,子进程叫worker +# worker_processes配置项表示开启几个业务进程,一般和cpu核数有关 +worker_processes 1; + +events &#123; + worker_connections 1024; +&#125; + +http &#123; + # include表示可以引入其他文件,此处表示引入http mime类型 + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + # 虚拟主机,可以配置多个 + server &#123; + listen 80; + server_name localhost; + + location / &#123; + # 路径匹配之后,哪个目录下去匹配相应的网页,html是相对路径 + root html; + index index.html index.htm; + &#125; + + error_page 500 502 503 504 /50x.html; + location = /50x.html &#123; + root html; + &#125; + &#125; +&#125; +</code></pre> +<p>去掉注释信息后,可以将 nginx.conf 配置文件分为三部分:</p> <ol> <li>全局块</li> </ol> -<pre><code class="language-conf">worker_processes 1; +<pre><code class="language-yaml">worker_processes 1; </code></pre> <p>从配置文件开始到 events 块之间的内容,主要会设置一些影响 Nginx 服务器整体运行的配置指令,主要包括:配置运行 Nginx 服务器的用户(组)、允许生成的 worker process 数,进程 PID 存放路径、日志存放路径和类型以及配置文件的引入等。</p> <p>上面这行 worker_processes 配置,是 Nginx 服务器并发处理服务的关键配置,该值越大,可以支持的并发处理量也越多,但是会受到硬件、软件等设备的约束。</p> <ol start="2"> <li>events 块</li> </ol> -<pre><code class="language-conf">events &#123; +<pre><code class="language-yaml">events &#123; worker_connections 1024; &#125; </code></pre> @@ -77,7 +110,7 @@ __反向代理:__看下面原理图,就一目了然。其实客户端对代 <ol start="3"> <li>http 块</li> </ol> -<pre><code class="language-conf">http &#123; +<pre><code class="language-yaml">http &#123; include mime.types; default_type application/octet-stream; sendfile on; @@ -107,25 +140,24 @@ __反向代理:__看下面原理图,就一目了然。其实客户端对代 <ol> <li>location 配置规则</li> </ol> -<pre><code class="language-conf">location [ = | ~ | ~* | ^~ | @ ] /uri &#123; +<pre><code class="language-yaml">location [ = | ~ | ~* | ^~ | @ ] /uri &#123; &#125; -= :用于不含正则表达式的 uri 前,要求请求字符串与 uri 严格匹配,如果匹配成功,就停止继续向下搜索并立即处理该请求。 -~:用于表示 uri 包含正则表达式,并且区分大小写。 -~*:用于表示 uri 包含正则表达式,并且不区分大小写。 -^~:用于不含正则表达式的 uri 前,要求 Nginx 服务器找到标识 uri 和请求字符串匹配度最高的 location -后,立即使用此 location 处理请求,而不再使用 location 块中的正则 uri 和请求字符串做匹配。 -@: &quot;@&quot; 定义一个命名的 location,使用在内部定向时,例如 error_page -/uri:不带任何修饰符,也表示前缀匹配,但是在正则匹配之后,如果没有正则命中,命中最长的规则 -/:通用匹配,任何未匹配到其它location的请求都会匹配到,相当于switch中的default +=   :用于不含正则表达式的 uri 前,要求请求字符串与 uri 严格匹配,如果匹配成功,就停止继续向下搜索并立即处理该请求。 +~ :用于表示 uri 包含正则表达式,并且区分大小写。 +~* :用于表示 uri 包含正则表达式,并且不区分大小写。 +^~ :用于不含正则表达式的 uri 前,要求 Nginx 服务器找到标识 uri 和请求字符串匹配度最高的location后,立即使用此 location 处理请求,而不再使用 location 块中的正则 uri 和请求字符串做匹配。 +@ : &quot;@&quot; 定义一个命名的 location,使用在内部定向时,例如 error_page +/uri :不带任何修饰符,也表示前缀匹配,但是在正则匹配之后,如果没有正则命中,命中最长的规则 +/ :通用匹配,任何未匹配到其它location的请求都会匹配到,相当于switch中的default -* uri没有“/”结尾时,location /abc/def可以匹配/abc/defghi请求,也可以匹配/abc/def/ghi等。而有“/”结尾时,location /abc/def/不能匹配/abc/defghi请求,只能匹配/abc/def/anything这样的请求 +☆☆☆☆☆ uri没有“/”结尾时,location /abc/def可以匹配/abc/defghi请求,也可以匹配/abc/def/ghi等。而有“/”结尾时,location /abc/def/不能匹配/abc/defghi请求,只能匹配/abc/def/anything这样的请求 </code></pre> <ol start="2"> <li>proxy_pass 配置规则</li> </ol> -<pre><code class="language-conf">url结尾加上了/,相当于是绝对路径,则Nginx不会把location中匹配的路径部分加入代理uri。 +<pre><code class="language-yaml">url结尾加上了/,相当于是绝对路径,则Nginx不会把location中匹配的路径部分加入代理uri。 url结尾不加/,Nginx则会把匹配的路径部分加入代理uri。 情景1: @@ -182,7 +214,7 @@ location /model &#123; &#125; </code></pre> <h4 id="nginx完整配置文件"><a class="anchor" href="#nginx完整配置文件">#</a> Nginx 完整配置文件</h4> -<pre><code class="language-conf">#user nobody; +<pre><code class="language-yaml">#user nobody; worker_processes 1; #error_log logs/error.log; @@ -344,7 +376,7 @@ sudo apt-get update &amp;&amp; sudo apt-get install yarn <ul> <li>配置 nginx (编译 /etc/nginx/sites-available/default)</li> </ul> -<pre><code class="language-conf">server &#123; +<pre><code class="language-yaml">server &#123; listen 80 default_server; listen [::]:80 default_server; @@ -544,7 +576,7 @@ ls b.txt &gt;&amp; output.txt #两个表达式效果一样的 <li>证书生成好并放置到 nginx 上。(证书生成方法不做介绍请自行百度)</li> <li>http 跳转 https 配置</li> </ol> -<pre><code class="language-conf">server &#123; +<pre><code class="language-yaml">server &#123; if ($scheme = http) &#123; rewrite ^(.*)$ https://$host$1 permanent; &#125; @@ -553,7 +585,7 @@ ls b.txt &gt;&amp; output.txt #两个表达式效果一样的 <ol start="4"> <li>web 端口监听配置</li> </ol> -<pre><code class="language-conf">#极空间-web +<pre><code class="language-yaml">#极空间-web server &#123; listen 10000 ssl http2; #ipv4 listen [::]:10000 ssl http2; #ipv6 @@ -646,7 +678,7 @@ server &#123; <li>路径映射(由于青龙面板有 nodejs 环境,所以我把 hexo 博客的编译也放置在上面,再把 nginx 的 html 映射过来,这样就可以直接编译发布了。)<br /> <img data-src="https://file.jingxiyuan.cn/images/2022/10/24/2022-10-24-19-29-06.jpg" alt="" /></li> </ul> -<pre><code class="language-conf">#青龙面板装载路径 +<pre><code class="language-yaml">#青龙面板装载路径 /ql/data #博客装载路径(如果你不部署hexo博客可以不用配置) /root/.ssh  #ssh证书文件(如果你不用把hexo推送到git上可以不用配置) @@ -673,13 +705,13 @@ server &#123; <code>0 */3 * * *</code></li> <li>环境变量</li> </ul> -<pre><code class="language-conf">名称:JD_COOKIE +<pre><code class="language-yaml">名称:JD_COOKIE 值:web京东登陆后按F12在网络tab页中的请求内查找cookie,然后复制pt_key=到pt_pin=等 </code></pre> <ul> <li>配置文件 (主要修改和添加以下配置)</li> </ul> -<pre><code class="language-conf">repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可 +<pre><code class="language-yaml">repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可 RepoFileExtensions=&quot;js py ts&quot; 钉钉(消息推送) export DD_BOT_TOKEN= @@ -711,7 +743,7 @@ export JD_PAY_CONTRACT=true <ul> <li>依赖管理</li> </ul> -<pre><code class="language-conf">#nodejs依赖 +<pre><code class="language-yaml">#nodejs依赖 crypto-js prettytable dotenv @@ -807,7 +839,7 @@ curl -sS https://bootstrap.pypa.io/get-pip.py | python3 <img data-src="https://file.jingxiyuan.cn/images/2022/10/21/2022-10-21-11-54-32204f14d87e95b59e.jpg" alt="" /></li> </ol> <h4 id="修改themeshoka配置"><a class="anchor" href="#修改themeshoka配置">#</a> 修改 Theme.Shoka 配置</h4> -<pre><code class="language-yml">valine: +<pre><code class="language-yaml">valine:  appId: 粘贴5中获取的App ID #Your_appId appKey: 粘贴5中获取的App Key #Your_appkey placeholder: ヽ(○´∀`)ノ♪欢迎畅所欲言 # Comment box placeholder @@ -869,7 +901,7 @@ curl -sS https://bootstrap.pypa.io/get-pip.py | python3 <ul> <li>此处配置为 nginx 反向代理,配置完成后可在外网连接访问</li> </ul> -<pre><code class="language-conf">stream &#123; +<pre><code class="language-yaml">stream &#123; #极空间-docker-mariadb upstream mariadb &#123; @@ -1226,7 +1258,7 @@ sudo systemctl status ndo2db.service <ol> <li>基础配置</li> </ol> -<pre><code class="language-conf">port 6379 +<pre><code class="language-yaml">port 6379 requirepass 123456(密码,建议不设置) vm-enabled no (虚拟内存,内存够的情况下可以不使用) maxmemory 1GB(告诉Redis当使用了多少物理内存后就开始拒绝后续的写入) @@ -1254,7 +1286,7 @@ echo never &gt; /sys/kernel/mm/transparent_hugepage/enabled <ol start="4"> <li>客户端缓冲区限制</li> </ol> -<pre><code class="language-conf">客户端的输出缓冲区的限制,因为某种原因客户端从服务器读取数据的速度不够快,可用于强制断开连接(一个常见的原因是一个发布 / 订阅客户端消费消息的速度无法赶上生产它们的速度)。 +<pre><code class="language-yaml">客户端的输出缓冲区的限制,因为某种原因客户端从服务器读取数据的速度不够快,可用于强制断开连接(一个常见的原因是一个发布 / 订阅客户端消费消息的速度无法赶上生产它们的速度)。 可以三种不同客户端的方式进行设置: normal -&gt; 正常客户端 slave -&gt; slave 和 MONITOR 客户端 @@ -1272,7 +1304,7 @@ client-output-buffer-limit pubsub 32mb 8mb 60 <ol start="5"> <li>持久化配置</li> </ol> -<pre><code class="language-conf">---关闭RDB持久化--- +<pre><code class="language-yaml">---关闭RDB持久化--- save &quot;&quot; 默认配置如下: save 900 1 #900秒内有1次更新就持久化 @@ -1297,7 +1329,7 @@ min-slaves-to-write 3 min-slaves-max-lag 10 设置当一个master端的可用slave少于N个,延迟时间大于M秒时,不接收写操作。 </code></pre> <h4 id="从服务"><a class="anchor" href="#从服务">#</a> 从服务</h4> -<pre><code class="language-conf">基本配置同主服务一致 +<pre><code class="language-yaml">基本配置同主服务一致 slaveof 127.0.0.1 6379(主redis的ip和端口) masterauth 123456 (主redis的密码) 可以通过slaveof no one命令将Slaver升级为Maste @@ -1341,7 +1373,7 @@ sudo sysctl vm.overcommit_memory=1 Fri, 14 Oct 2022 17:13:00 +0800 标签:2>&1 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:2>&1 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/360小工具/index.html b/tags/360小工具/index.html index f85274301..70798b5db 100644 --- a/tags/360小工具/index.html +++ b/tags/360小工具/index.html @@ -1 +1 @@ -标签:360小工具 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:360小工具 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/Hexo-admin/index.html b/tags/Hexo-admin/index.html index 3c7f8960e..d1baeed7c 100644 --- a/tags/Hexo-admin/index.html +++ b/tags/Hexo-admin/index.html @@ -1 +1 @@ -标签:Hexo-admin | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:Hexo-admin | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/Hexo/index.html b/tags/Hexo/index.html index 6dfcc3b82..b2aef6115 100644 --- a/tags/Hexo/index.html +++ b/tags/Hexo/index.html @@ -1 +1 @@ -标签:Hexo | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:Hexo | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/NodeJS/index.html b/tags/NodeJS/index.html index 52d639f2b..8027812c4 100644 --- a/tags/NodeJS/index.html +++ b/tags/NodeJS/index.html @@ -1 +1 @@ -标签:NodeJS | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:NodeJS | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/PicGo/index.html b/tags/PicGo/index.html index e8b59e5e2..1151ee6f1 100644 --- a/tags/PicGo/index.html +++ b/tags/PicGo/index.html @@ -1 +1 @@ -标签:PicGo | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:PicGo | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/Shell/index.html b/tags/Shell/index.html index a6fce85c2..b0b07228b 100644 --- a/tags/Shell/index.html +++ b/tags/Shell/index.html @@ -1 +1 @@ -标签:Shell | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:Shell | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/Shoka/index.html b/tags/Shoka/index.html index 861a842a4..3cd2fd4c1 100644 --- a/tags/Shoka/index.html +++ b/tags/Shoka/index.html @@ -1 +1 @@ -标签:Shoka | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:Shoka | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/Valine/index.html b/tags/Valine/index.html index 21dfb7b89..68b481b3e 100644 --- a/tags/Valine/index.html +++ b/tags/Valine/index.html @@ -1 +1 @@ -标签:Valine | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:Valine | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/Windows10/index.html b/tags/Windows10/index.html index aa1320752..6945786f9 100644 --- a/tags/Windows10/index.html +++ b/tags/Windows10/index.html @@ -1 +1 @@ -标签:Windows10 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:Windows10 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/Windows11/index.html b/tags/Windows11/index.html index 786789beb..05a96289c 100644 --- a/tags/Windows11/index.html +++ b/tags/Windows11/index.html @@ -1 +1 @@ -标签:Windows11 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:Windows11 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/Wordpress/index.html b/tags/Wordpress/index.html index a547be180..dc34129ea 100644 --- a/tags/Wordpress/index.html +++ b/tags/Wordpress/index.html @@ -1 +1 @@ -标签:Wordpress | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:Wordpress | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/algolia/index.html b/tags/algolia/index.html index a0d562ce8..78cf0fae9 100644 --- a/tags/algolia/index.html +++ b/tags/algolia/index.html @@ -1 +1 @@ -标签:algolia | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:algolia | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/chevereto/index.html b/tags/chevereto/index.html index 01a3bd56e..8a7831509 100644 --- a/tags/chevereto/index.html +++ b/tags/chevereto/index.html @@ -1 +1 @@ -标签:chevereto | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:chevereto | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/cookie/index.html b/tags/cookie/index.html index 8299ba680..32235f5ac 100644 --- a/tags/cookie/index.html +++ b/tags/cookie/index.html @@ -1 +1 @@ -标签:cookie | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:cookie | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/docker/index.html b/tags/docker/index.html index 45bc0d1c2..1a35aa214 100644 --- a/tags/docker/index.html +++ b/tags/docker/index.html @@ -1 +1 @@ -标签:docker | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:docker | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/git/index.html b/tags/git/index.html index 0137a7f80..8d693b4ff 100644 --- a/tags/git/index.html +++ b/tags/git/index.html @@ -1 +1 @@ -标签:git | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:git | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/https/index.html b/tags/https/index.html index c7a73d6ee..a57b5ed23 100644 --- a/tags/https/index.html +++ b/tags/https/index.html @@ -1 +1 @@ -标签:https | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:https | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/iframe/index.html b/tags/iframe/index.html index a5f5b2d79..df8dae802 100644 --- a/tags/iframe/index.html +++ b/tags/iframe/index.html @@ -1 +1 @@ -标签:iframe | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:iframe | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/index.html b/tags/index.html index 0b25a1753..7c5f4cbfb 100644 --- a/tags/index.html +++ b/tags/index.html @@ -1 +1 @@ -全部标签 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +全部标签 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/js/index.html b/tags/js/index.html index 8e023d169..61acc412b 100644 --- a/tags/js/index.html +++ b/tags/js/index.html @@ -1 +1 @@ -标签:js | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:js | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/mariadb/index.html b/tags/mariadb/index.html index 9eb86acbc..147531d13 100644 --- a/tags/mariadb/index.html +++ b/tags/mariadb/index.html @@ -1 +1 @@ -标签:mariadb | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:mariadb | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/mysql/index.html b/tags/mysql/index.html index 6f0da886d..17447571d 100644 --- a/tags/mysql/index.html +++ b/tags/mysql/index.html @@ -1 +1 @@ -标签:mysql | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:mysql | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/nagios/index.html b/tags/nagios/index.html index a17ebb094..c7401142e 100644 --- a/tags/nagios/index.html +++ b/tags/nagios/index.html @@ -1 +1 @@ -标签:nagios | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:nagios | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/netty/index.html b/tags/netty/index.html index 9be9c20a9..971bc6583 100644 --- a/tags/netty/index.html +++ b/tags/netty/index.html @@ -1 +1 @@ -标签:netty | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:netty | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/nginx/index.html b/tags/nginx/index.html index ea2f2db8b..45296c5bb 100644 --- a/tags/nginx/index.html +++ b/tags/nginx/index.html @@ -1 +1 @@ -标签:nginx | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:nginx | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/protobuf/index.html b/tags/protobuf/index.html index 4274dffb4..5ef18a52f 100644 --- a/tags/protobuf/index.html +++ b/tags/protobuf/index.html @@ -1 +1 @@ -标签:protobuf | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:protobuf | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/redis/index.html b/tags/redis/index.html index ff2b37130..761464809 100644 --- a/tags/redis/index.html +++ b/tags/redis/index.html @@ -1 +1 @@ -标签:redis | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:redis | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/socketIO/index.html b/tags/socketIO/index.html index 3ce46c439..54b8a127c 100644 --- a/tags/socketIO/index.html +++ b/tags/socketIO/index.html @@ -1 +1 @@ -标签:socketIO | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:socketIO | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/svn/index.html b/tags/svn/index.html index e7f8e8231..6f5844c40 100644 --- a/tags/svn/index.html +++ b/tags/svn/index.html @@ -1 +1 @@ -标签:svn | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:svn | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/vue/index.html b/tags/vue/index.html index 539da87c6..957295096 100644 --- a/tags/vue/index.html +++ b/tags/vue/index.html @@ -1 +1 @@ -标签:vue | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:vue | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/web/index.html b/tags/web/index.html index e2b4b94c3..f0bdf6102 100644 --- a/tags/web/index.html +++ b/tags/web/index.html @@ -1 +1 @@ -标签:web | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:web | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/yarn/index.html b/tags/yarn/index.html index 59adf2470..e55cf64a3 100644 --- a/tags/yarn/index.html +++ b/tags/yarn/index.html @@ -1 +1 @@ -标签:yarn | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:yarn | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/博客/index.html b/tags/博客/index.html index 84b405628..da9c47615 100644 --- a/tags/博客/index.html +++ b/tags/博客/index.html @@ -1 +1 @@ -标签:博客 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:博客 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/反向代理/index.html b/tags/反向代理/index.html index 733ad13a9..56f6a164d 100644 --- a/tags/反向代理/index.html +++ b/tags/反向代理/index.html @@ -1 +1 @@ -标签:反向代理 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:反向代理 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/图床/index.html b/tags/图床/index.html index 5a07eb694..499e653b0 100644 --- a/tags/图床/index.html +++ b/tags/图床/index.html @@ -1 +1 @@ -标签:图床 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:图床 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/图片上传/index.html b/tags/图片上传/index.html index bd2839850..76e4f63ea 100644 --- a/tags/图片上传/index.html +++ b/tags/图片上传/index.html @@ -1 +1 @@ -标签:图片上传 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:图片上传 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/定时任务/index.html b/tags/定时任务/index.html index ea6f2a514..a484cd226 100644 --- a/tags/定时任务/index.html +++ b/tags/定时任务/index.html @@ -1 +1 @@ -标签:定时任务 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:定时任务 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/心情/index.html b/tags/心情/index.html index a764f29a5..12bb4feeb 100644 --- a/tags/心情/index.html +++ b/tags/心情/index.html @@ -1 +1 @@ -标签:心情 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:心情 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/搜索/index.html b/tags/搜索/index.html index d8c1fe1ad..998273aba 100644 --- a/tags/搜索/index.html +++ b/tags/搜索/index.html @@ -1 +1 @@ -标签:搜索 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:搜索 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/服务监控/index.html b/tags/服务监控/index.html index 7fe6d0bdd..9fe8a4f1e 100644 --- a/tags/服务监控/index.html +++ b/tags/服务监控/index.html @@ -1 +1 @@ -标签:服务监控 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:服务监控 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/极空间/index.html b/tags/极空间/index.html index 43a8eb2af..dfd4e5e4f 100644 --- a/tags/极空间/index.html +++ b/tags/极空间/index.html @@ -1 +1 @@ -标签:极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:极空间 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/背景音乐/index.html b/tags/背景音乐/index.html index 3c202d735..cf076cf5a 100644 --- a/tags/背景音乐/index.html +++ b/tags/背景音乐/index.html @@ -1 +1 @@ -标签:背景音乐 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:背景音乐 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/自动更新/index.html b/tags/自动更新/index.html index f135a77d1..a1d3b79b0 100644 --- a/tags/自动更新/index.html +++ b/tags/自动更新/index.html @@ -1 +1 @@ -标签:自动更新 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:自动更新 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/评论/index.html b/tags/评论/index.html index 3c172c380..dbe860595 100644 --- a/tags/评论/index.html +++ b/tags/评论/index.html @@ -1 +1 @@ -标签:评论 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:评论 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/负载均衡/index.html b/tags/负载均衡/index.html index d98f0d409..db2a92ad6 100644 --- a/tags/负载均衡/index.html +++ b/tags/负载均衡/index.html @@ -1 +1 @@ -标签:负载均衡 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:负载均衡 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/踩坑/index.html b/tags/踩坑/index.html index 946568938..edf3ad16c 100644 --- a/tags/踩坑/index.html +++ b/tags/踩坑/index.html @@ -1 +1 @@ -标签:踩坑 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:踩坑 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/郁闷/index.html b/tags/郁闷/index.html index cd84fd2bf..37dcc1a17 100644 --- a/tags/郁闷/index.html +++ b/tags/郁闷/index.html @@ -1 +1 @@ -标签:郁闷 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:郁闷 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file diff --git a/tags/青龙面板/index.html b/tags/青龙面板/index.html index 8c60833d4..c167656c0 100644 --- a/tags/青龙面板/index.html +++ b/tags/青龙面板/index.html @@ -1 +1 @@ -标签:青龙面板 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file +标签:青龙面板 | ☆∵∴Hito∴∵★ = 涛声依旧 = 天下事有难易乎?为之,则难者亦易矣
\ No newline at end of file