<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/scripts/pretty-feed-v3.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:h="http://www.w3.org/TR/html4/"><channel><title>Jerry&apos;s ink</title><description>Stay hungry, stay foolish</description><link>https://jerryplusy.ink</link><item><title>鸽了很久了，更一篇</title><link>https://jerryplusy.ink/blog/technique/blog-style-reference</link><guid isPermaLink="true">https://jerryplusy.ink/blog/technique/blog-style-reference</guid><description>常用的 Markdown、MDX 写法列举</description><pubDate>Sat, 25 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import {
Aside,
Card,
CardList,
Collapse,
MdxRepl,
Spoiler,
Steps,
TabItem,
Tabs,
Timeline
} from &apos;astro-pure/user&apos;
import { GithubCard, LinkPreview, Quote } from &apos;astro-pure/advanced&apos;
export const keyIcon = import(&apos;@/assets/icons/key.svg?raw&apos;)&lt;/p&gt;
&lt;p&gt;export const today = new Date(&apos;2026-04-25T00:00:00+08:00&apos;)&lt;/p&gt;
&lt;p&gt;export const timelineEvents = [
{ date: &apos;2024-08&apos;, content: &apos;将博客迁移至 Astro&apos; },
{ date: &apos;2025-01&apos;, content: &apos;引入 MDX 组件，文章可玩性提高&apos; },
{ date: &apos;2026-04&apos;, content: &apos;优化样式及显示效果&apos; },
]&lt;/p&gt;
&lt;p&gt;export const roadmapList = [
{
title: &apos;数学&apos;,
children: [
{ title: &apos;导数的隐零点问题&apos; },
{ title: &apos;非线性回归预测模型&apos; }
]
},
{
title: &apos;物理&apos;,
children: [
{ title: &apos;电磁感应与运动学综合&apos; },
{ title: &apos;光电效应与原子物理&apos; }
]
},
{
title: &apos;信息&apos;,
children: [{ title: &apos;区间DP与嵌套DP&apos; }, { title: &apos;图论与二叉树综合&apos; }]
}
]&lt;/p&gt;
&lt;p&gt;很久没更新了，每天都忙着在学校学学学 :(&lt;/p&gt;
&lt;p&gt;这篇文章会把博客的常用样式都在这里渲染一遍，方便以后自查。&lt;/p&gt;
&lt;h2&gt;Markdown&lt;/h2&gt;
&lt;h3&gt;行内文本&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;粗体&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;斜体&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;~~删除线~~&lt;/li&gt;
&lt;li&gt;&lt;code&gt;行内代码&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;下划线&lt;/li&gt;
&lt;li&gt;上标: X2&lt;/li&gt;
&lt;li&gt;下标: H2O&lt;/li&gt;
&lt;li&gt;快捷键: Cmd + K&lt;/li&gt;
&lt;li&gt;Spoiler: 你知道的太多了&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;引用&amp;#x26;分隔线&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;鲁迅：我没说过这句话。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3&gt;列表&lt;/h3&gt;
&lt;p&gt;有序列表&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;先分析重力&lt;/li&gt;
&lt;li&gt;再分析弹力&lt;/li&gt;
&lt;li&gt;最后分析摩擦力&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;无序列表&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;羧酸可以和醇类物质发生酯化反应&lt;/li&gt;
&lt;li&gt;蔗糖在碱性条件下可以与斐林试剂发生显色反应，而酸性条件下则不能&lt;/li&gt;
&lt;li&gt;分子内含有手性碳原子代表分子存在空间异构体&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;任务列表&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[x] 编写框架&lt;/li&gt;
&lt;li&gt;[x] 补齐样式&lt;/li&gt;
&lt;li&gt;[ ] 撰写文档&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;脚注&lt;a href=&quot;%E5%9B%BE%E7%89%87%E4%BB%85%E4%BE%9B%E5%8F%82%E8%80%83%EF%BC%8C%E8%AF%B7%E4%BB%A5%E5%AE%9E%E7%89%A9%E4%B8%BA%E5%87%86&quot;&gt;^style-note&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;表格&lt;/h3&gt;
&lt;p&gt;| 分布列 | 数据1 | 数据2 | 数据3 |
|-----|-----|-----|-----|
| X   | 0.2 | 0.5 | 0.9 |
| P   | 0.1 | 0.4 | 0.5 |&lt;/p&gt;
&lt;h3&gt;代码块&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-ts&quot;&gt;export function formatTitle(raw: string) {
  return raw.trim().replace(/\s+/g, &apos; &apos;)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-ts&quot;&gt;const oldApi = &apos;/api/v1/post&apos; // [!code --]
const newApi = &apos;/api/v2/post&apos; // [!code ++]
const method = &apos;GET&apos;

console.log(method, newApi) // [!code highlight]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;#!/usr/bin/env bash
set -e
echo &quot;1) lint&quot;
echo &quot;2) typecheck&quot;
echo &quot;3) build&quot;
echo &quot;4) preview&quot;
echo &quot;5) publish&quot;
echo &quot;6) done&quot;
echo &quot;line 7&quot;
echo &quot;line 8&quot;
echo &quot;line 9&quot;
echo &quot;line 10&quot;
echo &quot;line 11&quot;
echo &quot;line 12&quot;
echo &quot;line 13&quot;
echo &quot;line 14&quot;
echo &quot;line 15&quot;
echo &quot;line 16&quot;
echo &quot;line 17&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;数学公式&lt;/h3&gt;
&lt;p&gt;行内公式: $E = mc^2$&lt;/p&gt;
&lt;p&gt;块级公式:&lt;/p&gt;
&lt;p&gt;$$
\int_{0}^{1} x^2 , dx = \frac{1}{3}
$$&lt;/p&gt;
&lt;h3&gt;折叠&lt;/h3&gt;
&lt;h2&gt;MDX&lt;/h2&gt;
&lt;h3&gt;Card&lt;/h3&gt;
&lt;h3&gt;Collapse&lt;/h3&gt;
&lt;h3&gt;Aside&lt;/h3&gt;
&lt;h3&gt;Tabs &amp;#x26; TabItem&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;bun run dev
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;MdxRepl&lt;/h3&gt;
&lt;h3&gt;CardList&lt;/h3&gt;
&lt;h3&gt;Timeline&lt;/h3&gt;
&lt;h3&gt;Steps&lt;/h3&gt;
&lt;h2&gt;Advanced&lt;/h2&gt;
&lt;h3&gt;Quote&lt;/h3&gt;
&lt;h3&gt;GithubCard&lt;/h3&gt;
&lt;h3&gt;LinkPreview&lt;/h3&gt;
&lt;p&gt;隐去封面图&lt;/p&gt;
&lt;p&gt;先写到这了，有别的之后再补充&lt;/p&gt;</content:encoded><h:img src="/_astro/markdown-hero.BxobWAbI.webp"/><enclosure url="/_astro/markdown-hero.BxobWAbI.webp"/></item><item><title>使用Nginx配合网页反代及内网穿透快速构建web内容</title><link>https://jerryplusy.ink/blog/technique/nginx-website-deployment</link><guid isPermaLink="true">https://jerryplusy.ink/blog/technique/nginx-website-deployment</guid><description>介绍如何使用Nginx部署网站和反代服务，结合frp实现内网穿透</description><pubDate>Sat, 20 Dec 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import Draw from &apos;../../../components/excalidraw/Draw.astro&apos;;&lt;/p&gt;
&lt;p&gt;在构建和部署 Web 服务时，&lt;strong&gt;Nginx&lt;/strong&gt; 作为轻量、高性能的 HTTP 服务器和反向代理工具，几乎是所有运维的必备利器。而对于云服务器资源有限的情况，还可以通过 &lt;strong&gt;frp&lt;/strong&gt; 结合 Nginx 实现内网穿透，让你在本地跑服务、远程部署，灵活又高效&lt;/p&gt;
&lt;h3&gt;Nginx原理&lt;/h3&gt;
&lt;p&gt;Nginx 全称 &lt;strong&gt;Engine X&lt;/strong&gt;，是一款高性能、事件驱动的 Web 服务器与反向代理服务器。它最擅长处理静态内容与高并发连接，工作机制如下：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;事件驱动&lt;/strong&gt;：采用 epoll/kqueue 实现高效异步 I/O&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;模块化架构&lt;/strong&gt;：支持通过模块扩展功能，如限速、防火墙、反代、缓存等&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;反向代理&lt;/strong&gt;：客户端请求并不直接访问目标服务，而是先到 Nginx，由它将请求“反向”转发到实际服务（如 Node.js、Python、PHP 等）上&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Nginx的安装与使用(以Debian为例)&lt;/h3&gt;
&lt;h4&gt;安装Nginx&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo apt-get update
sudo apt-get install nginx -y
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;启动与状态检查&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;访问服务器公网 IP，若出现 &lt;code&gt;Welcome to nginx&lt;/code&gt;，说明部署成功&lt;/p&gt;
&lt;h3&gt;构建反代 &amp;#x26; 静态网站配置示例&lt;/h3&gt;
&lt;p&gt;由于目前大多数网页服务都跑的是后端服务(即Node.js、Python、PHP)，所以只介绍反向代理的配置方法&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;假设我们有一个域名&lt;code&gt;jerryplusy.ink&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;我们可以通过以下步骤使Nginx将访问本域名的流量&lt;strong&gt;转发&lt;/strong&gt;到内网的目标端口上，这里&lt;strong&gt;假设我们的服务跑在&lt;code&gt;127.0.0.1:3000&lt;/code&gt;上&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;配置Nginx文件&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo nano /etc/nginx/sites-available/jerryplusy.ink.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-nginx&quot;&gt; server {
   listen 80;
   server_name jerryplusy.ink; # 自行修改域名
   root /var/www/jerryplusy.ink; # 自行修改域名
   index index.php index.html index.htm default.php default.html default.htm;

   # 防止访问敏感文件
   location ~ ^/(.user.ini|.htaccess|.git|.svn|.project|LICENSE|README.md|package.json|package-lock.json|.env) {
       return 404;
   }

   # Let&apos;s Encrypt 验证目录
   location /.well-known/ {
       allow all;
   }

   # 禁止验证目录运行脚本
   if ($uri ~ &quot;^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$&quot;) {
       return 403;
   }

   # 缓存图片/多媒体
   location ~* \.(gif|jpg|jpeg|png|bmp|swf)$ {
       expires 30d;
       access_log off;
       error_log off;
   }

   # 缓存 CSS 和 JS
   location ~* \.(js|css)?$ {
       expires 12h;
       access_log off;
       error_log off;
   }

   # 反向代理 Web 服务
   location ^~ / {
       proxy_pass http://127.0.0.1:3000; # 自行修改端口
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Forwarded-Host $http_host;
       proxy_set_header X-Forwarded-Port $server_port;
       proxy_set_header REMOTE-HOST $remote_addr;
       proxy_set_header REMOTE-PORT $remote_port;
       proxy_set_header Upgrade $http_upgrade;
       proxy_http_version 1.1;
       proxy_set_header Connection &quot;upgrade&quot;;

       add_header X-Cache $upstream_cache_status;

       # 判断静态资源缓存
       set $static_filejy2IN4nl 0;
       if ($uri ~* &quot;\.(gif|png|jpg|css|js|woff|woff2)$&quot;) {
           set $static_filejy2IN4nl 1;
           expires 1m;
       }
       if ($static_filejy2IN4nl = 0) {
           add_header Cache-Control no-cache;
       }
   }

   access_log /var/log/nginx/jerryplusy.ink.access.log; #根据需要修改
   error_log /var/log/nginx/jerryplusy.ink.error.log; #根据需要修改
 }
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;创建软链接启用站点&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo ln -s /etc/nginx/sites-available/jerryplusy.ink.conf /etc/nginx/sites-enabled/jerryplusy.ink.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;创建网站目录&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo mkdir -p /var/www/jerryplusy.ink.top
sudo chown -R www-data:www-data /var/www/jerryplusy.ink.top
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;测试并重载&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo nginx -t &amp;#x26;&amp;#x26; sudo systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;使用 FRP 本地运行服务 &amp;#x26; 内网穿透&lt;/h3&gt;
&lt;h4&gt;frp工作原理&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;frpc 运行在内网客户端，连接公网服务器的 frps&lt;/li&gt;
&lt;li&gt;公网服务器监听某个端口（如 7000），将访问转发回本地服务&lt;/li&gt;
&lt;li&gt;与 Nginx 配合，即可使用域名访问内网服务&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;FRP 配置示例&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;公网服务器（frps.ini）&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;[common]
bind_port = 7000
token = password
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;其中token为验证密钥，自行修改&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;本地机器（frpc.ini）：&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;[common]
server_addr = your.server.ip
server_port = 7000
token = password

[web]
type = tcp
local_port = 3000
remote_port = 2000
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;其中&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;[web]&lt;/code&gt;为你给这个隧道起的名字&lt;/li&gt;
&lt;li&gt;&lt;code&gt;type&lt;/code&gt;为连接类型，一般使用&lt;code&gt;tcp&lt;/code&gt;进行连接&lt;/li&gt;
&lt;li&gt;&lt;code&gt;local_port&lt;/code&gt;为本地运行服务的端口&lt;/li&gt;
&lt;li&gt;&lt;code&gt;remote_port&lt;/code&gt;为你想要映射到公网服务器的什么端口&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;frp启动命令:&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# 启动 frps
./frps -c ./frps.ini

# 启动 frpc
./frpc -c ./frpc.ini

&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;使用 Certbot 自动申请 HTTPS 证书&lt;/h3&gt;
&lt;p&gt;为了让网站支持 HTTPS，我们可以使用 &lt;code&gt;Let&apos;s Encrypt&lt;/code&gt; 提供的免费证书，搭配 &lt;code&gt;certbot&lt;/code&gt; 工具一键申请并自动续期&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# 安装 certbot
sudo apt-get install certbot python3-certbot-nginx -y

# 自动配置并签发证书
sudo certbot --nginx

# 测试自动续期
sudo certbot renew --dry-run
&lt;/code&gt;&lt;/pre&gt;</content:encoded><h:img src="/_astro/nginx.B0wREmEb.png"/><enclosure url="/_astro/nginx.B0wREmEb.png"/></item></channel></rss>