{"id":9872,"date":"2025-04-22T00:50:48","date_gmt":"2025-04-21T16:50:48","guid":{"rendered":"https:\/\/localhost\/?p=9872"},"modified":"2025-12-21T01:03:51","modified_gmt":"2025-12-20T17:03:51","slug":"nginx-%e5%8f%8d%e4%bb%a3-frp%ef%bc%9a%e9%83%a8%e7%bd%b2%e6%9c%ac%e5%9c%b0-wordpress","status":"publish","type":"post","link":"https:\/\/fanyiming.life\/?p=9872","title":{"rendered":"Nginx \u53cd\u4ee3 FRP\uff1a\u90e8\u7f72\u672c\u5730 WordPress"},"content":{"rendered":"\n<p>\u4ee5\u6bcf\u5e74 99 \u5143\u7684\u4f4e\u4ef7\u7528\u4e86\u4e24\u5e74\u963f\u91cc\u4e91\u670d\u52a1\u5668\u540e\uff0c\u5176\u6027\u80fd\u74f6\u9888\u6108\u53d1\u660e\u663e\uff1a\u4ec5\u8fd0\u884c WordPress \u5c1a\u53ef\uff0c\u7a0d\u52a0\u8d1f\u8f7d\u4fbf\u4f1a\u5361\u6b7b\uff0c\u6f2b\u957f\u7684\u91cd\u542f\u8fc7\u7a0b\u66f4\u662f\u4ee4\u4eba\u714e\u71ac\u3002\u9762\u5bf9\u5373\u5c06\u5230\u6765\u7684\u9ad8\u989d\u7eed\u8d39\uff0c\u6211\u9009\u62e9\u5c06 WordPress \u8fc1\u79fb\u81f3\u672c\u5730 Windows \u4e3b\u673a\uff0c\u4ee5\u53d1\u6325\u4e2a\u4eba\u7535\u8111\u7684\u8ba1\u7b97\u4f18\u52bf\u3002\u4e91\u670d\u52a1\u5668\u5219\u964d\u7ea7\u4e3a\u7eaf\u7cb9\u7684\u6d41\u91cf\u8f6c\u53d1\u8282\u70b9\uff0c\u901a\u8fc7 Nginx \u548c FRP \u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u3002\u8fd9\u79cd\u67b6\u6784\u6700\u5927\u7684\u597d\u5904\u662f\u7075\u6d3b\u6027\uff1a\u672a\u6765\u66f4\u6362\u4e91\u670d\u52a1\u5546\uff0c\u53ea\u9700\u5728\u65b0\u670d\u52a1\u5668\u4e0a\u914d\u7f6e Nginx \u548c frps \u5373\u53ef\uff0c\u5f7b\u5e95\u544a\u522b\u4e86\u4ee5\u5f80\u590d\u6742\u4e14\u9ad8\u98ce\u9669\u7684\u7f51\u7ad9\u4e0e\u6570\u636e\u5e93\u8fc1\u79fb\u5de5\u4f5c\u3002<\/p>\n\n\n\n<p>\u4f18\u52bf\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>localhost\u8bbf\u95ee\u901f\u5ea6<\/li>\n\n\n\n<li>\u8fd0\u7528\u672c\u5730windows\u7684\u9ad8\u6027\u80fdCPU\u8ba1\u7b97\u8d44\u6e90\u3001\u5927\u5bb9\u91cf\u5b58\u50a8\u3001GPU\u9700\u6c42<\/li>\n\n\n\n<li>\u6570\u636e\u638c\u63e1\u5728\u81ea\u5df1\u624b\u91cc\uff0c\u4e0d\u7528\u53d7\u4e91\u670d\u52a1\u5546\u7684\u76d1\u63a7<\/li>\n\n\n\n<li>\u975e\u5e38\u9002\u5408\u4f5c\u4e3a\u5f00\u53d1\u6216\u6d4b\u8bd5\u73af\u5883\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u672c\u5730\u5f00\u53d1\uff0c\u5e76\u901a\u8fc7\u516c\u7f51\u8fdb\u884c\u9884\u89c8\u548c\u6d4b\u8bd5\uff0c\u65e0\u9700\u9891\u7e41\u90e8\u7f72\u5230\u4e91\u670d\u52a1\u5668\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u7f3a\u70b9\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u540c\u65f6\u53d7\u9650\u4e8e\u4e91\u670d\u52a1\u5668\u7684\u5e26\u5bbd\u548c\u672c\u5730windows\u7684\u4e0a\u884c\u6d41\u91cf\uff0c\u8bbf\u95ee\u901f\u5ea6\u6253\u6298\u3002\u9664\u4e86\u5e26\u5bbd\u9650\u5236\uff0c\u6570\u636e\u5305\u5728 \u7528\u6237 -&gt; \u4e91 -&gt; \u672c\u5730 -&gt; \u4e91 -&gt; \u7528\u6237 \u4e4b\u95f4\u5f80\u8fd4\uff0c\u5fc5\u7136\u5f15\u5165\u989d\u5916\u7684\u7f51\u7edc\u5ef6\u8fdf\uff0c\u5bf9\u4e8e\u4ea4\u4e92\u6027\u8981\u6c42\u9ad8\u7684\u64cd\u4f5c\u4f53\u9a8c\u4f1a\u6709\u5f71\u54cd\u3002<\/li>\n\n\n\n<li>\u589e\u52a0\u4e86\u6545\u969c\u70b9\u3002\u4e91\u670d\u52a1\u5668\u3001\u672c\u5730 Windows \u4e3b\u673a\u3001\u672c\u5730\u7f51\u7edc\u3001frp \u670d\u52a1\u672c\u8eab\uff0c\u4efb\u4f55\u4e00\u4e2a\u73af\u8282\u51fa\u95ee\u9898\u90fd\u4f1a\u5bfc\u81f4\u7f51\u7ad9\u4e0d\u53ef\u8bbf\u95ee\u3002<\/li>\n\n\n\n<li>\u5bf9\u672c\u5730\u7f51\u7edc\u7684\u7a33\u5b9a\u6027\u548c\u516c\u7f51 IP\uff08\u5982\u679c\u662f\u52a8\u6001 IP \u53ef\u80fd\u9700\u8981 DDNS\uff09\u6709\u4f9d\u8d56\u3002<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u5173\u952e\u70b9<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Nginx\u7684\u4f5c\u7528<\/strong>\uff1a\u5728\u4e91\u670d\u52a1\u5668\u4e0a\u5904\u7406HTTPS\uff08TLS\/SSL\u5378\u8f7d\uff09\u5e76\u5c06\u89e3\u5bc6\u540e\u7684HTTP\u8bf7\u6c42\u8f6c\u53d1\u7ed9frps\u3002<\/li>\n\n\n\n<li><strong>frps\u4e0efrpc<\/strong>\uff1afrps\uff08\u670d\u52a1\u7aef\uff09\u8fd0\u884c\u5728\u4e91\u670d\u52a1\u5668\u4e0a\uff0cfrpc\uff08\u5ba2\u6237\u7aef\uff09\u8fd0\u884c\u5728\u5185\u7f51\uff08\u6216\u672c\u5730\uff09\u673a\u5668\u4e0a\u3002frpc\u4e3b\u52a8\u8fde\u63a5frps\uff0c\u5efa\u7acb\u4e00\u4e2a\u7a33\u5b9a\u7684\u96a7\u9053\u3002<\/li>\n\n\n\n<li><strong>\u6570\u636e\u6d41<\/strong>\uff1a\u5916\u90e8\u8bf7\u6c42 -&gt; Nginx -&gt; frps -&gt; frpc -&gt; Apache -&gt; WordPress\uff0c\u54cd\u5e94\u5219\u53cd\u5411\u6d41\u56de\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u6d41\u7a0b<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u7528\u6237\u5728\u6d4f\u89c8\u5668\u8f93\u5165\u57df\u540d\u3002<\/li>\n\n\n\n<li>\u6d4f\u89c8\u5668\u5411DNS\u670d\u52a1\u5668\u67e5\u8be2\u57df\u540d\u5bf9\u5e94\u7684IP\u5730\u5740\u3002<\/li>\n\n\n\n<li>DNS\u670d\u52a1\u5668\u8fd4\u56de\u4e91\u670d\u52a1\u5668\u7684\u516c\u7f51IP\u5730\u5740\u3002<\/li>\n\n\n\n<li>\u6d4f\u89c8\u5668\u5411\u4e91\u670d\u52a1\u5668IP\u768480\/443\u7aef\u53e3\u53d1\u8d77HTTP\/HTTPS\u8bf7\u6c42\u3002<\/li>\n\n\n\n<li>\u4e91\u670d\u52a1\u5668\u4e0a\u7684Nginx\u76d1\u542c80\/443\u7aef\u53e3\uff0c\u63a5\u6536\u8bf7\u6c42\u3002\u5982\u679c\u662fHTTPS(443)\uff0cNginx\u5904\u7406TLS\u63e1\u624b\u5e76\u89e3\u5bc6\u3002<\/li>\n\n\n\n<li>Nginx\u6839\u636e\u914d\u7f6e\uff0c\u5c06HTTP\u8bf7\u6c42\u53cd\u5411\u4ee3\u7406\u5230<strong>\u540c\u53f0\u4e91\u670d\u52a1\u5668<\/strong>\u4e0a\u76d1\u542cxxxx\u7aef\u53e3\u7684frps\u670d\u52a1\u3002<\/li>\n\n\n\n<li>frps\u901a\u8fc7<strong>\u9884\u5148\u7531frpc\u5efa\u7acb\u7684\u96a7\u9053<\/strong>\uff0c\u5c06\u8bf7\u6c42\u8f6c\u53d1\u7ed9\u5185\u7f51\u7684frpc\u5ba2\u6237\u7aef\u3002(frpc\u662f<em>\u4e3b\u52a8<\/em>\u8fde\u63a5\u5230frps\u5e76\u4fdd\u6301\u8fde\u63a5\u7684\uff0c\u8bf7\u6c42\u662f<em>\u901a\u8fc7<\/em>\u8fd9\u4e2a\u8fde\u63a5\u4f20\u8f93\uff0c\u800c\u4e0d\u662f\u6bcf\u6b21\u8bf7\u6c42\u90fd\u91cd\u65b0\u63e1\u624b\uff09\u3002<\/li>\n\n\n\n<li>frpc\u5ba2\u6237\u7aef\u63a5\u6536\u5230\u8bf7\u6c42\uff0c\u6839\u636e\u914d\u7f6e\u5c06\u5176\u8f6c\u53d1\u7ed9<strong>\u672c\u673a(localhost)<\/strong>\u4e0a\u76d1\u542cyyyy\u7aef\u53e3\u7684Apache\u670d\u52a1\u3002<\/li>\n\n\n\n<li>Apache\u63a5\u6536\u8bf7\u6c42\uff0c\u8c03\u7528PHP\u5904\u7406\uff08\u901a\u5e38\u901a\u8fc7mod_php\u6216PHP-FPM\uff09\uff0c\u6267\u884cWordPress\u7a0b\u5e8f\u3002<\/li>\n\n\n\n<li>WordPress\u5904\u7406\u8bf7\u6c42\u5e76\u751f\u6210\u54cd\u5e94\u6570\u636e\u3002<\/li>\n\n\n\n<li>\u54cd\u5e94\u6570\u636e\u9010\u7ea7\u8fd4\u56de\uff1aWordPress -&gt; Apache -&gt; frpc -&gt; frps (\u901a\u8fc7\u96a7\u9053) -&gt; Nginx -&gt; \u6d4f\u89c8\u5668\u3002<\/li>\n\n\n\n<li>Nginx\u5c06\u54cd\u5e94\u6570\u636e\uff08\u5982\u679c\u662fHTTPS\uff09\u52a0\u5bc6\u540e\u53d1\u9001\u7ed9\u6d4f\u89c8\u5668\u3002<\/li>\n\n\n\n<li>\u6d4f\u89c8\u5668\u63a5\u6536\u5e76\u6e32\u67d3\u6570\u636e\u3002<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-merpress-mermaidjs diagram-source-mermaid\"><pre class=\"mermaid\">sequenceDiagram\n    participant User as \u7528\u6237\/\u6d4f\u89c8\u5668\n    participant DNS as DNS\u670d\u52a1\u5668\n    participant Nginx as \u4e91\u670d\u52a1\u5668Nginx(\u516c\u7f51IP:80\/443)\n    participant frps as \u4e91\u670d\u52a1\u5668frps(\u76d1\u542cxxxx)\n    participant frpc as \u5185\u7f51frpc\u5ba2\u6237\u7aef\n    participant Apache as \u5185\u7f51Apache(\u76d1\u542cyyyy)\n    participant WP as \u5185\u7f51WordPress\n\n    Note right of frps: frpc\u9884\u5148\u8fde\u63a5frps\u5efa\u7acb\u96a7\u9053\n\n    User-&gt;&gt;DNS: \u67e5\u8be2\u57df\u540d A \u7684 IP \u5730\u5740\n    DNS--&gt;&gt;User: \u8fd4\u56de \u4e91\u670d\u52a1\u5668\u516c\u7f51IP\n\n    User-&gt;&gt;Nginx: 1. \u53d1\u8d77HTTPS\u8bf7\u6c42 (\u8bbf\u95ee\u57df\u540dA)\n    Nginx-&gt;&gt;Nginx: 2. TLS\u89e3\u5bc6\n    Nginx-&gt;&gt;frps: 3. \u53cd\u5411\u4ee3\u7406HTTP\u8bf7\u6c42 (\u8f6c\u53d1\u5230localhost:xxxx)\n    frps-&gt;&gt;frpc: 4. \u901a\u8fc7\u96a7\u9053\u8f6c\u53d1\u8bf7\u6c42\n    frpc-&gt;&gt;Apache: 5. \u8f6c\u53d1\u8bf7\u6c42\u5230localhost:yyyy\n    Apache-&gt;&gt;WP: 6. \u8c03\u7528WordPress\u5904\u7406\n    WP--&gt;&gt;Apache: 7. WordPress\u8fd4\u56de\u54cd\u5e94\n    Apache--&gt;&gt;frpc: 8. Apache\u8fd4\u56de\u54cd\u5e94\n    frpc--&gt;&gt;frps: 9. \u901a\u8fc7\u96a7\u9053\u8fd4\u56de\u54cd\u5e94\n    frps--&gt;&gt;Nginx: 10. frps\u8fd4\u56de\u54cd\u5e94\n    Nginx-&gt;&gt;Nginx: 11. TLS\u52a0\u5bc6\n    Nginx--&gt;&gt;User: 12. \u8fd4\u56deHTTPS\u54cd\u5e94\n    User-&gt;&gt;User: \u6e32\u67d3\u9875\u9762<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u6838\u5fc3\u4ee3\u7801<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Nginx\u53cd\u5411\u4ee3\u7406\u8bbe\u7f6e<\/h4>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2\"><span style=\"align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">Nginx<\/span><span role=\"button\" style=\"color:#d8dee9ff\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>#PROXY-START\/\n# \u8fd9\u4e2a\u6700\u597d\u901a\u8fc7\u5b9d\u5854\u9762\u677f\u5728\u524d\u7aef\u64cd\u4f5c\uff0c\u4ee5\u514d\u81ea\u5df1\u6539\u4ee3\u7801\u548c\u5b9d\u5854\u4ea7\u751f\u51b2\u7a81\n\n#PROXY-START\/\n\nlocation ^~ \/\n{\n    proxy_pass http:\/\/127.0.0.1:xxxx; # Frps\u670d\u52a1\u5668\u7684\u76d1\u542c\u7aef\u53e3\n    proxy_set_header Host $host; # \u4f20\u9012\u5ba2\u6237\u7aef\uff08\u6d4f\u89c8\u5668\uff09\u8bf7\u6c42\u7684\u540d\u5b57\n    proxy_set_header X-Forwarded-Host $host; # \u4f20\u9012\u5ba2\u6237\u7aef\uff08\u6d4f\u89c8\u5668\uff09\u8bf7\u6c42\u7684\u6807\u51c6\u4e3b\u673a\u540d\n    proxy_set_header X-Real-IP $remote_addr; # \u4f20\u9012\u5ba2\u6237\u7aef\u771f\u5b9eip\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # \u4f20\u9012\u5ba2\u6237\u7aefip\u548c\u4ee3\u7406\u7684ip\n    # &#8212; \u5173\u952e\u4fee\u6539\uff1a\u6dfb\u52a0\/\u786e\u4fdd\u6b63\u786e\u7684\u534f\u8bae\u548c\u7aef\u53e3\u5934 &#8212;\n    proxy_set_header X-Forwarded-Proto $scheme; # \u4f20\u9012\u534f\u8bae\n    proxy_set_header X-Forwarded-Port $server_port; # \u4f20\u9012\u76d1\u542c\u7aef\u53e3\n    # &#8212; \u5173\u952e\u4fee\u6539\u7ed3\u675f &#8212;\n    # proxy_set_header REMOTE-HOST $remote_addr; # \u8fd9\u4e2a\u5934\u901a\u5e38\u4e0d\u662f\u5fc5\u9700\u7684\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection &#8220;upgrade&#8221;; # \u4fee\u6539\u4e3a &#8220;upgrade&#8221; \u4ee5\u652f\u6301 WebSocket\n    proxy_http_version 1.1;\n    proxy_redirect off; # wordpress\u8ba9\u5173\u95ed\u91cd\u5b9a\u5411\n\n    # &#8212; \u79fb\u9664\/\u6ce8\u91ca\u6389\u5b9d\u5854\u81ea\u52a8\u6dfb\u52a0\u7684\u7f13\u5b58\u548c\u9759\u6001\u6587\u4ef6\u5224\u65ad\u903b\u8f91 &#8212;\n    # add_header X-Cache $upstream_cache_status;\n    # set $static_fileqalaflpo 0;\n    # if ( $uri ~* &#8220;\\.(gif|png|jpg|css|js|woff|woff2)$&#8221; )\n    # {\n    #   set $static_fileqalaflpo 1;\n    #   expires 1m;\n    # }\n    # if ( $static_fileqalaflpo = 0 )\n    # {\n    #    add_header Cache-Control no-cache;\n    # }\n    # &#8212; \u7ed3\u675f\u79fb\u9664\/\u6ce8\u91ca &#8212;\n}\n\n#PROXY-END\/\n<\/textarea><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\"><code><span class=\"line\"><span style=\"color: #616E88\">#PROXY-START\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># \u8fd9\u4e2a\u6700\u597d\u901a\u8fc7\u5b9d\u5854\u9762\u677f\u5728\u524d\u7aef\u64cd\u4f5c\uff0c\u4ee5\u514d\u81ea\u5df1\u6539\u4ee3\u7801\u548c\u5b9d\u5854\u4ea7\u751f\u51b2\u7a81<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">#PROXY-START\/<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">location<\/span><span style=\"color: #D8DEE9FF\"> ^<\/span><span style=\"color: #81A1C1\">~<\/span><span style=\"color: #D8DEE9FF\"> \/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_pass <\/span><span style=\"color: #D8DEE9FF\">http:\/\/127.0.0.1:xxxx<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\"># Frps\u670d\u52a1\u5668\u7684\u76d1\u542c\u7aef\u53e3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_set_header <\/span><span style=\"color: #D8DEE9FF\">Host <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">host<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\"># \u4f20\u9012\u5ba2\u6237\u7aef\uff08\u6d4f\u89c8\u5668\uff09\u8bf7\u6c42\u7684\u540d\u5b57<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_set_header <\/span><span style=\"color: #D8DEE9FF\">X-Forwarded-Host <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">host<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\"># \u4f20\u9012\u5ba2\u6237\u7aef\uff08\u6d4f\u89c8\u5668\uff09\u8bf7\u6c42\u7684\u6807\u51c6\u4e3b\u673a\u540d<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_set_header <\/span><span style=\"color: #D8DEE9FF\">X-Real-IP <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">remote_addr<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\"># \u4f20\u9012\u5ba2\u6237\u7aef\u771f\u5b9eip<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_set_header <\/span><span style=\"color: #D8DEE9FF\">X-Forwarded-For <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">proxy_add_x_forwarded_for<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\"># \u4f20\u9012\u5ba2\u6237\u7aefip\u548c\u4ee3\u7406\u7684ip<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># --- \u5173\u952e\u4fee\u6539\uff1a\u6dfb\u52a0\/\u786e\u4fdd\u6b63\u786e\u7684\u534f\u8bae\u548c\u7aef\u53e3\u5934 ---<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_set_header <\/span><span style=\"color: #D8DEE9FF\">X-Forwarded-Proto <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">scheme<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\"># \u4f20\u9012\u534f\u8bae<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_set_header <\/span><span style=\"color: #D8DEE9FF\">X-Forwarded-Port <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">server_port<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\"># \u4f20\u9012\u76d1\u542c\u7aef\u53e3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># --- \u5173\u952e\u4fee\u6539\u7ed3\u675f ---<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># proxy_set_header REMOTE-HOST $remote_addr; # \u8fd9\u4e2a\u5934\u901a\u5e38\u4e0d\u662f\u5fc5\u9700\u7684<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_set_header <\/span><span style=\"color: #D8DEE9FF\">Upgrade <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">http_upgrade<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_set_header <\/span><span style=\"color: #D8DEE9FF\">Connection <\/span><span style=\"color: #A3BE8C\">&quot;upgrade&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\"># \u4fee\u6539\u4e3a &quot;upgrade&quot; \u4ee5\u652f\u6301 WebSocket<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_http_version <\/span><span style=\"color: #D8DEE9FF\">1.1<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #81A1C1\"> proxy_redirect <\/span><span style=\"color: #D8DEE9FF\">off<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\"># wordpress\u8ba9\u5173\u95ed\u91cd\u5b9a\u5411<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># --- \u79fb\u9664\/\u6ce8\u91ca\u6389\u5b9d\u5854\u81ea\u52a8\u6dfb\u52a0\u7684\u7f13\u5b58\u548c\u9759\u6001\u6587\u4ef6\u5224\u65ad\u903b\u8f91 ---<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># add_header X-Cache $upstream_cache_status;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># set $static_fileqalaflpo 0;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># if ( $uri ~* &quot;\\.(gif|png|jpg|css|js|woff|woff2)$&quot; )<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\">#   set $static_fileqalaflpo 1;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\">#   expires 1m;<\/span><\/span>\n<span class=\"line cbp-see-more-line \"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># if ( $static_fileqalaflpo = 0 )<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\">#    add_header Cache-Control no-cache;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># --- \u7ed3\u675f\u79fb\u9664\/\u6ce8\u91ca ---<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">#PROXY-END\/<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><span style=\"align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#2e3440ff;color:#c8d0e0;font-size:12px;line-height:1;position:relative\">proxy.conf<\/span><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>\u4ee5\u4e0b\u662f<a href=\"https:\/\/developer.wordpress.org\/advanced-administration\/security\/https\/\">wordpress\u5b98\u65b9\u6587\u6863\u7684\u63a8\u8350\u914d\u7f6e<\/a>\uff08\u9002\u7528\u4e8e\u53cd\u5411\u4ee3\u7406\uff09\uff1a<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2\"><span style=\"align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">JavaScript<\/span><span role=\"button\" style=\"color:#d8dee9ff\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>location \/ {\n    proxy_pass http:\/\/your_host_name:your_port;\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header X-Forwarded-Host $server_name;\n    proxy_set_header X-Forwarded-Proto $scheme; \/\/\u8fd9\u4e2a\u544a\u8bc9frps\u670d\u52a1\u7aef\u534f\u8bae\u662fhttps\u8fd8\u662fhttp\n    proxy_redirect off; \/\/\u8fd9\u4e2a\u5f88\u91cd\u8981\uff0c\u5173\u95ednginx\u672c\u8eab\u5bf9\u4e8e\u57df\u540d\u7684\u91cd\u5b9a\u5411\uff0c\u4ee5\u514d\u8ddfwordpress\u7684\u91cd\u5b9a\u5411\u89c4\u5219\u51b2\u7a81\n}<\/textarea><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">location<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">proxy_pass<\/span><span style=\"color: #D8DEE9FF\"> http<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #616E88\">\/\/your_host_name:your_port;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">proxy_set_header<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Host<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">$host<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">proxy_set_header<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">X<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">Real<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">IP<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">$remote_addr<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">proxy_set_header<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">X<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">Forwarded<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">For<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">$proxy_add_x_forwarded_for<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">proxy_set_header<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">X<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">Forwarded<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">Host<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">$server_name<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">proxy_set_header<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">X<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">Forwarded<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">Proto<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">$scheme<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\">\/\/\u8fd9\u4e2a\u544a\u8bc9frps\u670d\u52a1\u7aef\u534f\u8bae\u662fhttps\u8fd8\u662fhttp<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">proxy_redirect<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">off<\/span><span style=\"color: #81A1C1\">;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\">\/\/\u8fd9\u4e2a\u5f88\u91cd\u8981\uff0c\u5173\u95ednginx\u672c\u8eab\u5bf9\u4e8e\u57df\u540d\u7684\u91cd\u5b9a\u5411\uff0c\u4ee5\u514d\u8ddfwordpress\u7684\u91cd\u5b9a\u5411\u89c4\u5219\u51b2\u7a81<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><span style=\"align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#2e3440ff;color:#c8d0e0;font-size:12px;line-height:1;position:relative\">JavaScript<\/span><\/div>\n\n\n\n<p class=\"has-d-8-dee-9-ff-color has-text-color has-875-rem-font-size\">\u4f46\u662f\u8981\u6ce8\u610f\uff1a<br>proxy_set_header X-Forwarded-Host $host; # \u4f20\u9012\u5ba2\u6237\u7aef\uff08\u6d4f\u89c8\u5668\uff09\u8bf7\u6c42\u7684\u6807\u51c6\u4e3b\u673a\u540d<br><br>\u4e0a\u9762\u8fd9\u4e00\u884c\u8981\u6ce8\u610f\u5c3d\u91cf\u662f $host\uff0c\u800c\u975e$server_name\uff0c\u56e0\u4e3a\u5728\u524d\u9762\u7684nginx.conf\u4e2d\u5f88\u53ef\u80fd\u914d\u7f6e\u4e86\u591a\u4e2aserver_name\uff0c\u8fd9\u65f6\u5019\u5982\u679c\u7528proxy_set_header X-Forwarded-Host\u4f20\u9012\u7684\u9ed8\u8ba4\u662f\u7b2c\u4e00\u4e2a\uff0c\u5982\u679c\u4f60\u521a\u597d\u8ddf\u6d4f\u89c8\u5668\u8f93\u5165\u7684\u57df\u540d\u4e0d\u4e00\u6837\uff08\u6bd4\u5982\u662fip\u5730\u5740\uff09\uff0c\u5c31\u4f1a\u5bfc\u81f4\u4e00\u4e9b\u9759\u6001\u8d44\u6e90\u5230\u65f6\u5019\u4ee5https:\/\/ip\u5730\u5740\/xxx\u7684\u5f62\u5f0f\u8bf7\u6c42\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h4 class=\"wp-block-heading\">frp\u5185\u7f51\u7a7f\u900f<\/h4>\n\n\n\n<p>\u8fd9\u91cc\u6211\u9047\u5230\u4e00\u4e2a\u5927\u5751\u554a\uff0c\u6309\u7406\u8bf4\uff0c\u4e0a\u9762\u901a\u8fc7proxy_set_header X-Forwarded-Proto $scheme\u5df2\u7ecf\u5c06\u534f\u8bae\uff08http or https\uff09\u4f20\u9012\u7ed9\u4e86frps\uff0cfrps\u5e94\u8be5\u539f\u6837\u4f20\u9012\u7ed9frpc\uff0c\u6211\u7684SSL\u8bc1\u4e66\u662f\u90e8\u7f72\u5728nginx\u6240\u5728\u7684\u4e91\u670d\u52a1\u5668\u7684\uff0cnginx\u89e3\u6790https\u5185\u5bb9\u540e\uff0c\u4ee5http\u7684\u65b9\u5f0f\u7ed9frps\uff0c\u8fdb\u800c\u6211\u672c\u5730\u5e94\u8be5\u8ba9wordpress\u901a\u8fc7\u4f20\u9012\u6765\u7684 $scheme\u7684\u503c\u8c03\u6574\u5185\u90e8url\u5904\u7406\u65b9\u5f0f\u5168\u90e8https\uff08\u5373\u4fbf\u63a5\u6536\u5230\u7684\u6570\u636e\u5b9e\u9645\u4e0a\u662f\u6765\u81eahttp\u7684\uff09\u4f46\u662f\u5b9e\u6d4b\u4e0b\u6765\uff0cfrpc\u63a5\u6536\u5230\u7684X-Forwarded-Proto\u5374\u662fhttp\u3002\u6392\u67e5\u4e86\u597d\u4e45\u597d\u4e45\uff0c\u5728github\u7684\u8ba8\u8bba\u533a\u627e\u5230<a href=\"https:\/\/github.com\/fatedier\/frp\/issues\/4462\">\u4e00\u4e2aissue<\/a>\uff0c\u7ec8\u4e8e\u53d1\u73b0\u662f\u65b0\u7248\u4f1a\u81ea\u52a8\u628ahttps\u8f6c\u6210http\uff0c\u4e8e\u662f\u56de\u9000\u52300.51.3\u624d\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2\"><span style=\"align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">Frps<\/span><span role=\"button\" style=\"color:#d8dee9ff\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>bindPort = zzzz # \u9700\u8981\u8ddffrpc\u8bbe\u7f6e\u4fdd\u6301\u4e00\u81f4\nvhostHTTPPort = xxxx # \u8ddfNginx\u8bbe\u7f6e\u4fdd\u6301\u4e00\u81f4\nauth.token = &#8220;your_secret_token&#8221;    # \u5fc5\u987b\u52a0\uff0c\u7f51\u7edc\u5b89\u5168\u5927\u4e8e\u5929\ntransport.tls.force = true # \u5f3a\u5236TLS\u52a0\u5bc6<\/textarea><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">bindPort <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> zzzz # \u9700\u8981\u8ddffrpc\u8bbe\u7f6e\u4fdd\u6301\u4e00\u81f4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">vhostHTTPPort <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> xxxx # \u8ddfNginx\u8bbe\u7f6e\u4fdd\u6301\u4e00\u81f4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">auth.token <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">your_secret_token<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">    # \u5fc5\u987b\u52a0\uff0c\u7f51\u7edc\u5b89\u5168\u5927\u4e8e\u5929<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">transport.tls.force <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">true<\/span><span style=\"color: #D8DEE9FF\"> # \u5f3a\u5236TLS\u52a0\u5bc6<\/span><\/span><\/code><\/pre><span style=\"align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#2e3440ff;color:#c8d0e0;font-size:12px;line-height:1;position:relative\">frps.ini<\/span><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2\"><span style=\"align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">Frpc<\/span><span role=\"button\" style=\"color:#d8dee9ff\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>serverAddr = &#8220;xx.xxx.xxx.x&#8221;  # \u516c\u7f51ip\u5730\u5740\nserverPort = zzzz # \u9700\u8981\u8ddffrps\u8bbe\u7f6e\u4fdd\u6301\u4e00\u81f4\nauth.token = &#8220;your_secret_token&#8221;    # \u6dfb\u52a0\u8ba4\u8bc1token\uff0c\u9700\u8981\u4e0e\u670d\u52a1\u5668\u7aef\u914d\u7f6e\u76f8\u540c\n\n[[proxies]]\nname = &#8220;web&#8221;\ntype = &#8220;http&#8221; # \u8bc1\u4e66\u662f\u5728\u4e91\u670d\u52a1\u5668\u800c\u975e\u672c\u5730\uff0cfrps\u548cfrpc\u4e4b\u95f4\u901a\u8fc7http\u901a\u4fe1\nlocalPort = 80  # \u786e\u8ba4Apache\u76d1\u542c\u4e00\u81f4\u7684\u7aef\u53e3\ncustomDomains = [&#8220;your_domain.com&#8221;]\n\n[transport]\nproxyURL = &#8220;socks5:\/\/127.0.0.1:1080&#8221; # \u53ef\u9009\uff0c\u5982\u679cLocalhost\u5f00\u542f\u4e86\u4ee3\u7406\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u63a7\u5236\u662f\u5426\u8d70\u4ee3\u7406<\/textarea><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">serverAddr <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">xx.xxx.xxx.x<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">  # \u516c\u7f51ip\u5730\u5740<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">serverPort <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> zzzz # \u9700\u8981\u8ddffrps\u8bbe\u7f6e\u4fdd\u6301\u4e00\u81f4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">auth.token <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">your_secret_token<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">    # \u6dfb\u52a0\u8ba4\u8bc1token\uff0c\u9700\u8981\u4e0e\u670d\u52a1\u5668\u7aef\u914d\u7f6e\u76f8\u540c<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">[[<\/span><span style=\"color: #D8DEE9FF\">proxies<\/span><span style=\"color: #81A1C1\">]]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">name <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">web<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">type<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">http<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> # \u8bc1\u4e66\u662f\u5728\u4e91\u670d\u52a1\u5668\u800c\u975e\u672c\u5730\uff0cfrps\u548cfrpc\u4e4b\u95f4\u901a\u8fc7http\u901a\u4fe1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">localPort <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">80<\/span><span style=\"color: #D8DEE9FF\">  # \u786e\u8ba4Apache\u76d1\u542c\u4e00\u81f4\u7684\u7aef\u53e3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">customDomains <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">[<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">your_domain.com<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">]<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">[<\/span><span style=\"color: #D8DEE9FF\">transport<\/span><span style=\"color: #81A1C1\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">proxyURL <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">socks5:\/\/127.0.0.1:1080<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> # \u53ef\u9009\uff0c\u5982\u679cLocalhost\u5f00\u542f\u4e86\u4ee3\u7406\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u63a7\u5236\u662f\u5426\u8d70\u4ee3\u7406<\/span><\/span><\/code><\/pre><span style=\"align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#2e3440ff;color:#c8d0e0;font-size:12px;line-height:1;position:relative\">frpc.ini<\/span><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">wordpress\u914d\u7f6e<\/h3>\n\n\n\n<p>wordpress\u7684\u77db\u76fe\u70b9\u5728\u4e8e\uff0c\u5b9e\u9645\u63a5\u6536\u5230\u7684\u90fd\u662f\u5df2\u7ecf\u7ecf\u8fc7\u4e91\u670d\u52a1\u5668nginx\u89e3\u6790\u540e\u7684http\u6570\u636e\uff0c\u5374\u81ea\u4ee5\u4e3a\u662fhttps\uff08\u56e0\u4e3a\u8bbf\u5ba2\u4ece\u6d4f\u89c8\u5668\u8f93\u5165https:\/\/domain.com\u8bbf\u95ee\uff09\uff0c\u5f15\u8d77mixed content\u9519\u8bef\u3002\u6211\u7684\u505a\u6cd5\u662f\uff0c\u5c31\u4fdd\u6301\u540e\u53f0siteurl\u548chome\u7684\u503c\u4e3a&#8221;http:\/\/localhost&#8221;\uff0c\u8fd9\u6837\u7684\u597d\u5904\u662f\uff0c\u672c\u673a\u76f4\u63a5\u8bbf\u95eelocalhost\u4e00\u70b9\u95ee\u9898\u90fd\u6ca1\u6709\uff0c\u5b83\u4e0d\u8d70frpc\u7684\u6d41\u91cf\uff0c\u5145\u5206\u53d1\u6325localhost\u7684\u4fbf\u6377\u4f18\u52bf\u3002\u800c\u4ecehttps\u57df\u540d\u8bbf\u95ee\u65f6\uff0c\u5728wp-config.php\u52a0\u51e0\u884c\u989d\u5916\u5224\u65ad\uff1a<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2\"><span style=\"align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">PHP<\/span><span role=\"button\" style=\"color:#d8dee9ff\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>if (isset($_SERVER[&#8216;HTTP_X_FORWARDED_PROTO&#8217;]) &amp;&amp; $_SERVER[&#8216;HTTP_X_FORWARDED_PROTO&#8217;] == &#8216;https&#8217;) {\n    $_SERVER[&#8216;HTTPS&#8217;] = &#8216;on&#8217;;\n    $_SERVER[&#8216;HTTP_HOST&#8217;] = $_SERVER[&#8216;HTTP_X_FORWARDED_HOST&#8217;];\n    define(&#8216;WP_HOME&#8217;, &#8216;https:\/\/&#8217; . $_SERVER[&#8216;HTTP_HOST&#8217;]);\n    define(&#8216;WP_SITEURL&#8217;, &#8216;https:\/\/&#8217; . $_SERVER[&#8216;HTTP_HOST&#8217;]);\n    define(&#8216;FORCE_SSL_ADMIN&#8217;, true);\n}\n\n\n\/* That&#8217;s all, stop editing! Happy publishing. *\/<\/textarea><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\"><code><span class=\"line\"><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">isset<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_SERVER<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">HTTP_X_FORWARDED_PROTO<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">])<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&amp;&amp;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_SERVER<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">HTTP_X_FORWARDED_PROTO<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">]<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">==<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">https<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_SERVER<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">HTTPS<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">]<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">on<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_SERVER<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">HTTP_HOST<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">]<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_SERVER<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">HTTP_X_FORWARDED_HOST<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">]<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">define<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">WP_HOME<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #88C0D0\"> <\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">https:\/\/<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #88C0D0\"> <\/span><span style=\"color: #81A1C1\">.<\/span><span style=\"color: #88C0D0\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_SERVER<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">HTTP_HOST<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">])<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">define<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">WP_SITEURL<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #88C0D0\"> <\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">https:\/\/<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #88C0D0\"> <\/span><span style=\"color: #81A1C1\">.<\/span><span style=\"color: #88C0D0\"> <\/span><span style=\"color: #81A1C1\">$<\/span><span style=\"color: #D8DEE9\">_SERVER<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">HTTP_HOST<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">])<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">define<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #A3BE8C\">FORCE_SSL_ADMIN<\/span><span style=\"color: #ECEFF4\">&#039;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #88C0D0\"> <\/span><span style=\"color: #81A1C1\">true<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/* That&#039;s all, stop editing! Happy publishing. *\/<\/span><\/span><\/code><\/pre><span style=\"align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#2e3440ff;color:#c8d0e0;font-size:12px;line-height:1;position:relative\">wp-config.php<\/span><\/div>\n\n\n\n<p>\u4ee5\u4e0a\u4ee3\u7801\u7684\u610f\u601d\u662f\uff0c\u5982\u679cfrpc\u63a5\u6536\u5230\u7684HTTP_X_FORWARDED_PROTO\u534f\u8bae\u662fhttps\uff08\u5373\u4ece\u6d4f\u89c8\u5668\u8f93\u5165\u57df\u540d\u8bbf\u95ee\u7684\u60c5\u51b5\uff09\uff0c\u5c31\u5f3a\u5236\u8ba9wordpress\u628a\u5185\u90e8\u94fe\u63a5\u5934\u5168\u90e8\u66ff\u6362\u6210https\uff0c\u540c\u65f6\u6839\u636efrpc\u63a5\u6536\u5230\u7684HTTP_HOST\uff08\u5373\u57df\u540d\uff09\u4fee\u6539home\u548csiteurl\u7684\u503c\u4e3ahttps:\/\/\u57df\u540d\uff0c\u4ece\u800c\u8ba9\u6240\u6709\u6d4f\u89c8\u5668\u8bf7\u6c42\u7684\u8d44\u6e90\u90fd\u4ee5https:\/\/\u57df\u540d\/xxxxxx.xx\u5f00\u5934\uff0c\u4e0d\u4f1a\u51fa\u73b0mixed content\u9519\u8bef\u3002\uff08\u53cb\u60c5\u63d0\u793a\uff0c\u5982\u679c\u4e0d\u89e3\u51b3https\u548chttp\u7ed5\u6765\u7ed5\u53bb\u7684\u5173\u7cfb\uff0c\u4e0d\u4ec5\u662f\u51fa\u73b0mixed content\uff0c\u8fd8\u53ef\u80fd\u56e0\u4e3awordpress\u5185\u90e8\u7684url\u68c0\u67e5\u5bfc\u81f4\u67d0\u4e9b\u9875\u9762\uff0c\u5982\u9996\u9875\u6216\u540e\u53f0\u9996\u9875\uff0c\u9677\u5165301\/302\u91cd\u5b9a\u5411\u5faa\u73af\uff09\uff0c\u6211\u5f00\u59cb\u627e\u4e86\u4e00\u5806\u63d2\u4ef6\u5e0c\u671b\u80fd\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u540e\u6765\u53d1\u73b0\u8fd8\u662f\u4e0a\u9762\u7684\u4ee3\u7801\u6700\u76f4\u89c2\u548c\u4e00\u52b3\u6c38\u9038\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<figure class=\"wp-block-pullquote\"><blockquote><p>\u6309\u60ef\u4f8b\uff0c\u81f4\u656c\u4f1f\u5927\u7684AI\u8001\u5e08\uff01<\/p><\/blockquote><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<p>PS. \u540e\u6765\u67d0\u6b21wordpress\u7248\u672c\u66f4\u65b0\u4ee5\u540e\uff0c\u4ee5\u4e0a\u6d41\u7a0b\u51fa\u4e86\u4e00\u70b9\u70b9\u95ee\u9898\uff1a\u201c\u8f93\u5165fanyiming.life\/wp-admin\u4f1a\u81ea\u52a8\u8df3\u8f6clocalhost\u7684\u767b\u5f55\u9875\u9762\uff08\u5bfc\u81f4\u65e0\u6cd5\u8fdc\u7a0b\u8bbf\u95ee\uff09\uff0c\u4f46\u662f\u5176\u4ed6\u9875\u9762\u7684\u8df3\u8f6c\u90fd\u662f\u6b63\u5e38\u7684\uff0c\u4e0d\u4f1a\u88ab\u91cd\u5b9a\u5411\u5230localhost\u3002\u201d<\/p>\n\n\n\n<p>Gemini\u8001\u5e08\u7ed9\u51fa\u7684\u89e3\u51b3\u65b9\u6848\u5982\u4e0b\uff0c\u5df2\u91c7\u7eb3\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u60a8\u597d\uff01\u60a8\u9047\u5230\u7684\u8fd9\u4e2a\u95ee\u9898\u975e\u5e38\u5178\u578b\uff0c\u662f\u53cd\u5411\u4ee3\u7406\uff08\u7279\u522b\u662f\u60a8\u8fd9\u79cd Nginx -&gt; FRP -&gt; \u672c\u5730\u670d\u52a1\u5668 \u7684\u591a\u5c42\u4ee3\u7406\uff09\u90e8\u7f72 WordPress \u65f6\u5e38\u89c1\u7684\u4e00\u4e2a\u75db\u70b9\u3002<\/p>\n\n\n\n<p>\u60a8\u63d0\u4f9b\u7684\u6587\u6863\u975e\u5e38\u8be6\u5c3d\uff0c\u5bf9\u6574\u4e2a\u67b6\u6784\u7684\u7406\u89e3\u4e5f\u5f88\u5230\u4f4d\u3002\u95ee\u9898\u7684\u539f\u56e0\u57fa\u672c\u53ef\u4ee5\u9501\u5b9a\u5728 WordPress \u672c\u8eab\u5904\u7406\u540e\u53f0\u767b\u5f55\u548c\u91cd\u5b9a\u5411\u7684\u673a\u5236\u4e0a\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u95ee\u9898\u6839\u6e90\u5206\u6790<\/h3>\n\n\n\n<p>\u7b80\u5355\u6765\u8bf4\uff0c<strong>\u95ee\u9898\u51fa\u5728 WordPress \u7684&nbsp;<code>wp-login.php<\/code>&nbsp;\u548c\u540e\u53f0\u533a\u57df&nbsp;<code>\/wp-admin\/<\/code>&nbsp;\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u3001\u66f4\u4e25\u683c\u7684\u91cd\u5b9a\u5411\u548c URL \u5224\u65ad\u903b\u8f91\u3002<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u6570\u636e\u5e93\u4e2d\u7684 \u201c\u6743\u5a01\u201d \u5730\u5740<\/strong>\uff1a\u60a8\u5728 WordPress \u540e\u53f0\u8bbe\u7f6e\u7684 \u201c\u7ad9\u70b9\u5730\u5740 (URL)\u201d \u548c \u201cWordPress \u5730\u5740 (URL)\u201d \u662f&nbsp;<code>http:\/\/localhost<\/code>\u3002\u8fd9\u5bf9 WordPress \u6765\u8bf4\uff0c\u662f\u5b83\u8eab\u4efd\u7684\u201c\u6700\u7ec8\u6743\u5a01\u201d\u3002<\/li>\n\n\n\n<li><strong>\u524d\u53f0\u9875\u9762\u7684\u201c\u6b3a\u9a97\u201d\u6210\u529f<\/strong>\uff1a\u5bf9\u4e8e\u7f51\u7ad9\u524d\u53f0\u9875\u9762\uff08\u5982\u6587\u7ae0\u3001\u9875\u9762\uff09\uff0c\u60a8\u5728&nbsp;<code>wp-config.php<\/code>&nbsp;\u4e2d\u6dfb\u52a0\u7684\u4ee3\u7801\u6210\u529f\u5730\u201c\u6b3a\u9a97\u201d\u4e86 WordPress\u3002\u5f53\u8bf7\u6c42\u901a\u8fc7&nbsp;<code>fanyiming.life<\/code>&nbsp;\u8bbf\u95ee\u65f6\uff0c<code>HTTP_X_FORWARDED_PROTO<\/code>&nbsp;\u548c&nbsp;<code>HTTP_X_FORWARDED_HOST<\/code>&nbsp;\u8fd9\u4e24\u4e2a Header \u8ba9 WordPress \u4e34\u65f6\u8ba4\u4e3a\u81ea\u5df1\u7684\u5730\u5740\u662f&nbsp;<code>https:\/\/fanyiming.life<\/code>\uff0c\u5e76\u6b63\u786e\u5730\u751f\u6210\u4e86\u9875\u9762\u5185\u7684\u94fe\u63a5\uff0c\u6240\u4ee5\u524d\u53f0\u8bbf\u95ee\u6b63\u5e38\u3002<\/li>\n\n\n\n<li><strong>\u540e\u53f0\u767b\u5f55\u7684\u201c\u53db\u9006\u201d<\/strong>\uff1a\u5f53\u60a8\u8bbf\u95ee&nbsp;<code>fanyiming.life\/wp-admin<\/code>&nbsp;\u65f6\uff0cWordPress \u4f1a\u89e6\u53d1\u767b\u5f55\u9a8c\u8bc1\u6d41\u7a0b\u3002\u8fd9\u4e2a\u6d41\u7a0b\u4e2d\u7684\u67d0\u4e9b\u6838\u5fc3\u51fd\u6570\uff08\u4f8b\u5982&nbsp;<code>wp_login_url()<\/code>&nbsp;\u6216\u5176\u4ed6\u5185\u90e8\u91cd\u5b9a\u5411\u51fd\u6570\uff09<strong>\u53ef\u80fd\u6ca1\u6709\u5b8c\u5168\u9075\u5faa&nbsp;<code>wp-config.php<\/code>&nbsp;\u4e2d&nbsp;<code>define<\/code>&nbsp;\u7684&nbsp;<code>WP_SITEURL<\/code>\uff0c\u800c\u662f\u76f4\u63a5\u6216\u95f4\u63a5\u5730\u8bfb\u53d6\u4e86\u6570\u636e\u5e93\u4e2d\u90a3\u4e2a\u201c\u6743\u5a01\u201d\u7684&nbsp;<code>http:\/\/localhost<\/code>&nbsp;\u5730\u5740<\/strong>\uff0c\u7136\u540e\u751f\u6210\u4e86\u4e00\u4e2a\u6307\u5411&nbsp;<code>http:\/\/localhost\/wp-login.php?...<\/code>&nbsp;\u7684\u91cd\u5b9a\u5411\u6307\u4ee4\uff08HTTP 302 Found\uff09\u3002\u60a8\u7684\u6d4f\u89c8\u5668\u6536\u5230\u8fd9\u4e2a\u6307\u4ee4\u540e\uff0c\u5c31\u4e56\u4e56\u5730\u8df3\u8f6c\u5230\u4e86&nbsp;<code>localhost<\/code>&nbsp;\u7684\u767b\u5f55\u9875\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>\u603b\u7ed3\uff1a<\/strong>&nbsp;\u60a8\u7684&nbsp;<code>wp-config.php<\/code>&nbsp;\u914d\u7f6e\u5bf9\u524d\u53f0\u751f\u6548\u4e86\uff0c\u4f46\u540e\u53f0\u7684\u767b\u5f55\u548c\u7ba1\u7406\u533a\u57df\u56e0\u4e3a\u5176\u81ea\u8eab\u7684\u5b89\u5168\u548c\u91cd\u5b9a\u5411\u673a\u5236\uff0c\u201c\u8bc6\u7834\u201d\u4e86\u8fd9\u4e2a\u201c\u9a97\u5c40\u201d\uff0c\u56de\u5f52\u4e86\u6570\u636e\u5e93\u91cc\u7684\u672c\u6e90\u5730\u5740&nbsp;<code>http:\/\/localhost<\/code>\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u89e3\u51b3\u65b9\u6848<\/h3>\n\n\n\n<p>\u6709\u4e24\u79cd\u89e3\u51b3\u65b9\u6848\uff0c<strong>\u5f3a\u70c8\u63a8\u8350\u65b9\u6848\u4e00<\/strong>\uff0c\u56e0\u4e3a\u5b83\u662f\u4e00\u52b3\u6c38\u9038\u4e14\u6700\u89c4\u8303\u7684\u505a\u6cd5\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u65b9\u6848\u4e00\uff1a\u3010\u63a8\u8350\u3011\u7edf\u4e00\u5185\u5916\u7f51\u8bbf\u95ee\u5730\u5740\uff0c\u4fee\u6539\u672c\u5730 hosts \u6587\u4ef6<\/h4>\n\n\n\n<p>\u8fd9\u662f\u6700\u7a33\u5b9a\u3001\u6700\u6839\u672c\u7684\u89e3\u51b3\u65b9\u6848\u3002\u6838\u5fc3\u601d\u60f3\u662f\u8ba9 WordPress \u4ece\u59cb\u81f3\u7ec8\u53ea\u8ba4\u4e00\u4e2a\u5730\u5740&nbsp;<code>https:\/\/fanyiming.life<\/code>\uff0c\u7136\u540e\u901a\u8fc7\u4fee\u6539\u60a8\u672c\u5730\u7535\u8111\u7684&nbsp;<code>hosts<\/code>&nbsp;\u6587\u4ef6\u6765\u5b9e\u73b0\u5feb\u901f\u7684\u672c\u5730\u8bbf\u95ee\u3002<\/p>\n\n\n\n<p><strong>\u6b65\u9aa4 1\uff1a\u4fee\u6539 WordPress \u6570\u636e\u5e93\u4e2d\u7684\u5730\u5740<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u767b\u5f55\u60a8\u7684 WordPress \u540e\u53f0\uff08\u73b0\u5728\u53ef\u80fd\u9700\u8981\u5148\u7528\u65b9\u6848\u4e8c\u4e34\u65f6\u4fee\u590d\uff0c\u6216\u8005\u76f4\u63a5\u5728\u672c\u5730\u901a\u8fc7&nbsp;<code>http:\/\/localhost\/wp-admin<\/code>&nbsp;\u767b\u5f55\uff09\u3002<\/li>\n\n\n\n<li>\u8fdb\u5165&nbsp;<strong>\u8bbe\u7f6e -&gt; \u5e38\u89c4<\/strong>\u3002<\/li>\n\n\n\n<li>\u5c06&nbsp;<strong>WordPress \u5730\u5740 (URL)<\/strong>&nbsp;\u548c&nbsp;<strong>\u7ad9\u70b9\u5730\u5740 (URL)<\/strong>&nbsp;\u5168\u90e8\u4fee\u6539\u4e3a\u60a8\u7684\u516c\u7f51\u57df\u540d\uff1a<code>https:\/\/fanyiming.life<\/code>\u3002<\/li>\n\n\n\n<li>\u4fdd\u5b58\u66f4\u6539\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>\u6b65\u9aa4 2\uff1a\u4fee\u6539\u672c\u5730 Windows \u7684 hosts \u6587\u4ef6<\/strong><\/p>\n\n\n\n<p>\u8fd9\u4e2a\u6587\u4ef6\u7684\u4f5c\u7528\u662f\u5728\u60a8\u7684\u7535\u8111\u4e0a\u5efa\u7acb\u4e00\u4e2a\u672c\u5730\u7684 DNS \u8bb0\u5f55\uff0c\u8ba9\u57df\u540d\u76f4\u63a5\u6307\u5411\u672c\u5730 IP\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u7528<strong>\u7ba1\u7406\u5458\u6743\u9650<\/strong>\u6253\u5f00\u8bb0\u4e8b\u672c\uff08Notepad\uff09\u3002<\/li>\n\n\n\n<li>\u5728\u8bb0\u4e8b\u672c\u4e2d\uff0c\u70b9\u51fb \u6587\u4ef6 -&gt; \u6253\u5f00\uff0c\u7136\u540e\u5bfc\u822a\u5230&nbsp;<code>C:\\Windows\\System32\\drivers\\etc\\<\/code>\u3002<\/li>\n\n\n\n<li>\u5728\u53f3\u4e0b\u89d2\u6587\u4ef6\u7c7b\u578b\u9009\u62e9\u201c\u6240\u6709\u6587\u4ef6(*.*)\u201d\uff0c\u7136\u540e\u6253\u5f00&nbsp;<code>hosts<\/code>&nbsp;\u6587\u4ef6\u3002<\/li>\n\n\n\n<li>\u5728\u6587\u4ef6\u7684\u672b\u5c3e\u6dfb\u52a0\u65b0\u7684\u4e00\u884c\uff1aTEXT<code>127.0.0.1 fanyiming.life<\/code><\/li>\n\n\n\n<li>\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>\u6b65\u9aa4 3\uff1a\u8c03\u6574&nbsp;<code>wp-config.php<\/code><\/strong><\/p>\n\n\n\n<p>\u73b0\u5728 WordPress \u7684\u201c\u6743\u5a01\u201d\u5730\u5740\u5df2\u7ecf\u662f\u6b63\u786e\u7684\u516c\u7f51\u5730\u5740\u4e86\uff0c<code>wp-config.php<\/code>&nbsp;\u91cc\u7684&nbsp;<code>define<\/code>&nbsp;\u5c31\u4e0d\u518d\u662f\u5fc5\u987b\u7684\u4e86\u3002\u60a8\u53ef\u4ee5\u5c06\u4e4b\u524d\u6dfb\u52a0\u7684&nbsp;<code>define('WP_HOME', ...)<\/code>&nbsp;\u548c&nbsp;<code>define('WP_SITEURL', ...)<\/code>&nbsp;\u8fd9\u4e24\u884c<strong>\u5220\u9664\u6216\u6ce8\u91ca\u6389<\/strong>\u3002\u4f46\u4e3a\u4e86\u786e\u4fdd\u53cd\u5411\u4ee3\u7406\u4e0b\u7684 HTTPS \u80fd\u88ab\u6b63\u786e\u8bc6\u522b\uff0c\u4fdd\u7559\u5176\u4ed6\u90e8\u5206\u4ecd\u7136\u662f\u597d\u4e60\u60ef\u3002<\/p>\n\n\n\n<p>\u7b80\u5316\u540e\u7684&nbsp;<code>wp-config.php<\/code>&nbsp;\u5224\u65ad\u903b\u8f91\u53ef\u4ee5\u8fd9\u6837\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PHP<code>if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &amp;&amp; $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {\n    $_SERVER['HTTPS'] = 'on';\n}\n\n\/* That's all, stop editing! Happy publishing. *\/\n<\/code><\/pre>\n\n\n\n<p><code>FORCE_SSL_ADMIN<\/code>&nbsp;\u4e5f\u53ef\u4ee5\u4fdd\u7559\uff0c\u56e0\u4e3a\u5b83\u73b0\u5728\u4f1a\u6b63\u786e\u5730\u5c06 http \u8bf7\u6c42\u91cd\u5b9a\u5411\u5230&nbsp;<code>https:\/\/fanyiming.life\/wp-admin<\/code>\u3002<\/p>\n\n\n\n<p><strong>\u8fd9\u6837\u505a\u7684\u597d\u5904\uff1a<\/strong><\/p>\n\n\n\n<p><strong>\u5f7b\u5e95\u89e3\u51b3\u95ee\u9898<\/strong>\uff1a\u6240\u6709\u7531 URL \u6df7\u4e71\u5bfc\u81f4\u7684\u95ee\u9898\uff08\u5305\u62ec\u540e\u53f0\u91cd\u5b9a\u5411\u3001AJAX \u8bf7\u6c42\u5931\u8d25\u3001\u63d2\u4ef6\u517c\u5bb9\u6027\u95ee\u9898\u7b49\uff09\u90fd\u4f1a\u6d88\u5931<br><\/p>\n\n\n\n<p><strong>\u914d\u7f6e\u7edf\u4e00<\/strong>\uff1aWordPress \u7684\u914d\u7f6e\u53d8\u5f97\u975e\u5e38\u5e72\u51c0\uff0c\u4e0d\u518d\u6709\u4e24\u5957\u5730\u5740\u7684\u51b2\u7a81\u3002<\/p>\n\n\n\n<p><strong>\u5185\u5916\u517c\u5f97<\/strong>\uff1a<\/p>\n\n\n\n<p>\u5f53\u60a8\u5728<strong>\u672c\u5730\u7535\u8111<\/strong>\u7684\u6d4f\u89c8\u5668\u8bbf\u95ee&nbsp;<code>fanyiming.life<\/code>&nbsp;\u65f6\uff0c<code>hosts<\/code>&nbsp;\u6587\u4ef6\u4f1a\u8ba9\u8bf7\u6c42\u76f4\u63a5\u53d1\u9001\u5230&nbsp;<code>127.0.0.1<\/code>\uff0c\u4e0d\u7ecf\u8fc7\u4e91\u670d\u52a1\u5668\u548c FRP\uff0c\u5b9e\u73b0\u60a8\u60f3\u8981\u7684<strong>\u672c\u5730\u6781\u901f\u8bbf\u95ee\u548c\u5f00\u53d1<\/strong>\u3002<\/p>\n\n\n\n<p>\u5f53<strong>\u5916\u90e8\u7528\u6237<\/strong>\u8bbf\u95ee&nbsp;<code>fanyiming.life<\/code>&nbsp;\u65f6\uff0c\u4ed6\u4eec\u901a\u8fc7\u516c\u7f51 DNS \u89e3\u6790\u5230\u60a8\u7684\u4e91\u670d\u52a1\u5668\uff0c\u6d41\u7a0b\u548c\u539f\u6765\u4e00\u6837\uff0c\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u3002<\/p>\n\n\n\n<p><strong>\u4e00\u4e2a\u5c0f\u63d0\u793a (A Small Tip):<\/strong><\/p>\n\n\n\n<p>\u5f53\u60a8\u5728\u672c\u5730\u901a\u8fc7&nbsp;<code>https:\/\/fanyiming.life<\/code>&nbsp;\u8bbf\u95ee\u65f6\uff0c\u7531\u4e8e\u60a8\u7684 SSL \u8bc1\u4e66\u90e8\u7f72\u5728\u4e91\u670d\u52a1\u5668\u7684 Nginx \u4e0a\uff0c\u800c\u672c\u5730 Apache \u670d\u52a1\u5668\u4e0a\u6ca1\u6709\u8fd9\u4e2a\u8bc1\u4e66\uff0c\u60a8\u7684\u6d4f\u89c8\u5668\u53ef\u80fd\u4f1a\u63d0\u793a\u201c\u4e0d\u5b89\u5168\u201d\u6216\u201c\u8bc1\u4e66\u9519\u8bef\u201d\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5bf9\u4e8e\u5f00\u53d1\u6d4b\u8bd5<\/strong>\uff1a\u76f4\u63a5\u70b9\u51fb\u201c\u9ad8\u7ea7\u201d -&gt; \u201c\u7ee7\u7eed\u524d\u5f80\u201d\u5373\u53ef\uff0c\u8fd9\u4e0d\u5f71\u54cd\u529f\u80fd\u3002<\/li>\n\n\n\n<li><strong>\u5982\u679c\u60f3\u6d88\u9664\u8fd9\u4e2a\u8b66\u544a<\/strong>\uff1a\u60a8\u53ef\u4ee5\u5728\u672c\u5730\u4e5f\u914d\u7f6e\u4e00\u4e2a SSL \u8bc1\u4e66\uff08\u4f8b\u5982\u4f7f\u7528&nbsp;<code>mkcert<\/code>&nbsp;\u5de5\u5177\u751f\u6210\u4e00\u4e2a\u672c\u5730\u4fe1\u4efb\u7684\u81ea\u7b7e\u540d\u8bc1\u4e66\uff09\uff0c\u4f46\u8fd9\u4f1a\u589e\u52a0\u4e00\u4e9b\u914d\u7f6e\u590d\u6742\u5ea6\uff0c\u901a\u5e38\u6ca1\u6709\u5fc5\u8981\u3002<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<p><\/p>\n\n\n\n<p>2025-07-08 \u9996\u9875\u91cd\u5b9a\u5411\u5904\u7406\u62a5\u544a\uff1a<a href=\"https:\/\/fanyiming.life\/?p=10611\">https:\/\/fanyiming.life\/?p=10611<\/a><\/p>\n\n\n\n<p>2025-07-10 \u9996\u9875\u91cd\u5b9a\u5411\u5904\u7406\u62a5\u544a-2\uff1a<a href=\"https:\/\/fanyiming.life\/?p=10623\">https:\/\/fanyiming.life\/?p=10623<\/a><\/p>\n\n\n\n<p>2025-07-11 \u672c\u5730\u81ea\u7b7e\u540dSSL\u8bc1\u4e66\uff1a<a href=\"\/?p=10637\">https:\/\/fanyiming.life\/?p=10637<\/a><\/p>\n\n\n\n<p>2025-07-21 \u9996\u9875\u91cd\u5b9a\u5411\u5904\u7406\u62a5\u544a-3\uff1a<a href=\"\/?p=10818\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">https:\/\/fanyiming.life\/?p=10818<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3b\u4eba\u5acc\u5f03\u4e91\u670d\u52a1\u5668\u53c8\u6162\u53c8\u8d35\uff0c\u628aWordPress\u642c\u56de\u672c\u5730\u7528\u9ad8\u6027\u80fd\u7535\u8111\u8dd1\uff0c\u518d\u7528Nginx\u548cFRP\u7ec4\u5408\u62f3\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u3002\u8fd9\u62db\u65e2\u7701\u94b1\u53c8\u7075\u6d3b\uff0c\u6570\u636e\u8fd8\u7262\u7262\u63e1\u5728\u81ea\u5df1\u624b\u91cc\uff0c\u5c31\u662f\u914d\u7f6e\u65f6\u5f97\u8ddf\u5404\u79cd\u4ee3\u7406\u534f\u8bae\u6597\u667a\u6597\u52c7\u4e00\u756awwww\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-9872","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/fanyiming.life\/index.php?rest_route=\/wp\/v2\/posts\/9872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fanyiming.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fanyiming.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fanyiming.life\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fanyiming.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9872"}],"version-history":[{"count":10,"href":"https:\/\/fanyiming.life\/index.php?rest_route=\/wp\/v2\/posts\/9872\/revisions"}],"predecessor-version":[{"id":13865,"href":"https:\/\/fanyiming.life\/index.php?rest_route=\/wp\/v2\/posts\/9872\/revisions\/13865"}],"wp:attachment":[{"href":"https:\/\/fanyiming.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fanyiming.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fanyiming.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}