{"id":107,"date":"2025-12-10T20:08:55","date_gmt":"2025-12-10T12:08:55","guid":{"rendered":"https:\/\/zcc609.online\/?p=107"},"modified":"2025-12-10T20:08:55","modified_gmt":"2025-12-10T12:08:55","slug":"%e5%a4%9a%e9%a1%b9%e7%9b%ae%e5%85%b1%e5%ad%98%e9%83%a8%e7%bd%b2%e6%96%b9%e6%a1%88-wordpress%e5%8d%9a%e5%ae%a2%e4%b8%8e%e9%a4%90%e5%8e%85%e9%a2%84%e8%ae%a2%e7%b3%bb%e7%bb%9f%ef%bc%88%e5%90%8c","status":"publish","type":"post","link":"https:\/\/zcc609.online\/?p=107","title":{"rendered":"\u591a\u9879\u76ee\u5171\u5b58\u90e8\u7f72\u65b9\u6848 &#8211; WordPress\u535a\u5ba2\u4e0e\u9910\u5385\u9884\u8ba2\u7cfb\u7edf\uff08\u540c\u4e00\u63a5\u53e3\u4e0d\u540c\u57df\u540d\uff09"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u95ee\u9898\u80cc\u666f<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u670d\u52a1\u5668\u4e0a\u5df2\u6709 WordPress \u535a\u5ba2\u8fd0\u884c\u5728 80\/443 \u7aef\u53e3<\/li>\n\n\n\n<li>\u9700\u8981\u90e8\u7f72\u9910\u5385\u9884\u8ba2\u7cfb\u7edf\u5230\u540c\u4e00\u670d\u52a1\u5668<\/li>\n\n\n\n<li>\u8981\u6c42\uff1a\u4e24\u4e2a\u7cfb\u7edf\u72ec\u7acb\u8bbf\u95ee\uff0c\u4f7f\u7528\u6807\u51c6\u7aef\u53e3\uff08\u65e0\u9700\u7aef\u53e3\u53f7\uff09<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u51b3\u65b9\u6848\uff1a\u540c IP \u540c\u7aef\u53e3 + \u4e0d\u540c\u57df\u540d<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u6838\u5fc3\u539f\u7406<\/h3>\n\n\n\n<p>\u901a\u8fc7 Nginx \u7684&nbsp;<code class=\"\">server_name<\/code>&nbsp;\u6307\u4ee4\uff0c\u6839\u636e HTTP \u8bf7\u6c42\u5934\u7684&nbsp;<code class=\"\">Host<\/code>&nbsp;\u5b57\u6bb5\u533a\u5206\u4e0d\u540c\u7f51\u7ad9\uff0c\u5b9e\u73b0\u4e00\u4e2a IP\u3001\u4e00\u4e2a\u7aef\u53e3\u670d\u52a1\u591a\u4e2a\u57df\u540d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u67b6\u6784\u56fe<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u670d\u52a1\u5668 IP: YOUR_SERVER_IP\n    \u2502\n    \u251c\u2500\u2500 \u7aef\u53e3 80\/443\n    \u2502   \u251c\u2500\u2500 \u57df\u540d: www.example.com \u2192 WordPress \u535a\u5ba2\n    \u2502   \u2514\u2500\u2500 \u57df\u540d: restaurant.example.com \u2192 \u9910\u5385\u7cfb\u7edf\n    \u2502\n    \u2514\u2500\u2500 \u7aef\u53e3 8080 (\u5185\u90e8)\n        \u2514\u2500\u2500 Spring Boot \u540e\u7aef API\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u914d\u7f6e\u6b65\u9aa4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9aa41\uff1aDNS \u89e3\u6790\u914d\u7f6e<\/h3>\n\n\n\n<p>\u5728\u57df\u540d\u7ba1\u7406\u540e\u53f0\u6dfb\u52a0 A \u8bb0\u5f55\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u4e3b\u673a\u8bb0\u5f55\uff1arestaurant\n\u8bb0\u5f55\u7c7b\u578b\uff1aA\n\u8bb0\u5f55\u503c\uff1aYOUR_SERVER_IP\nTTL\uff1a600\n\n<\/pre><\/div>\n\n\n<p><strong>\u7ed3\u679c<\/strong>\uff1a&nbsp;<code class=\"\">restaurant.example.com<\/code>&nbsp;\u2192&nbsp;<code class=\"\">YOUR_SERVER_IP<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9aa42\uff1aNginx \u914d\u7f6e<\/h3>\n\n\n\n<p><strong>\u4e00\u952e\u914d\u7f6e\u547d\u4ee4<\/strong>\uff08\u76f4\u63a5\u5728\u670d\u52a1\u5668\u6267\u884c\uff09\uff1a<\/p>\n\n\n\n<p><strong>bash<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# \u5907\u4efd\u539f\u914d\u7f6e\ncp \/www\/server\/panel\/vhost\/nginx\/restaurant.conf \/www\/server\/panel\/vhost\/nginx\/restaurant.conf.bak\n\n# \u5199\u5165\u65b0\u914d\u7f6e\ncat &gt; \/www\/server\/panel\/vhost\/nginx\/restaurant.conf &amp;lt;&amp;lt; 'EOF'\nserver {\n    listen 80;\n    server_name restaurant.example.com;\n\n    root \/home\/restaurant-reservation\/frontend\/dist;\n    index index.html;\n\n    location \/ {\n        try_files $uri $uri\/ \/index.html;\n    }\n\n    location \/api\/ {\n        proxy_pass http:\/\/127.0.0.1:8080\/api\/;\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-Proto $scheme;\n    }\n\n    access_log  \/www\/wwwlogs\/restaurant.log;\n    error_log   \/www\/wwwlogs\/restaurant.error.log;\n}\nEOF\n\n# \u6d4b\u8bd5\u914d\u7f6e\nnginx -t\n\n# \u91cd\u542f Nginx\n\/etc\/init.d\/nginx restart\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9aa43\uff1a\u9a8c\u8bc1\u914d\u7f6e<\/h3>\n\n\n\n<p><strong>bash<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# DNS \u89e3\u6790\u9a8c\u8bc1\nnslookup restaurant.example.com\n\n# HTTP \u8bbf\u95ee\u9a8c\u8bc1\ncurl -I http:\/\/restaurant.example.com\n\n# \u7aef\u53e3\u76d1\u542c\u9a8c\u8bc1\nnetstat -tlnp | grep :80\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u5173\u952e\u914d\u7f6e\u5bf9\u6bd4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u535a\u5ba2\u914d\u7f6e\uff08\/www\/server\/panel\/vhost\/nginx\/blog.conf\uff09<\/h3>\n\n\n\n<p><strong>nginx<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nserver {\n    listen 80;\n    listen 443 ssl;\n    server_name www.example.com;  # \u535a\u5ba2\u57df\u540d\n    root \/www\/wwwroot\/wordpress;\n    # ... \u5176\u4ed6\u914d\u7f6e\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u9910\u5385\u7cfb\u7edf\u914d\u7f6e\uff08\/www\/server\/panel\/vhost\/nginx\/restaurant.conf\uff09<\/h3>\n\n\n\n<p><strong>nginx<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nserver {\n    listen 80;  # \u540c\u4e00\u4e2a 80 \u7aef\u53e3\n    server_name restaurant.example.com;  # \u9910\u5385\u57df\u540d\n    root \/home\/restaurant-reservation\/frontend\/dist;\n    # ... \u5176\u4ed6\u914d\u7f6e\n}\n\n<\/pre><\/div>\n\n\n<p><strong>\u5173\u952e\u70b9<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2705 \u4e24\u4e2a\u914d\u7f6e\u90fd\u76d1\u542c 80 \u7aef\u53e3\uff08\u4e0d\u51b2\u7a81\uff09<\/li>\n\n\n\n<li>\u2705 \u901a\u8fc7\u00a0<code class=\"\">server_name<\/code>\u00a0\u533a\u5206\u4e0d\u540c\u7f51\u7ad9<\/li>\n\n\n\n<li>\u2705 Nginx \u81ea\u52a8\u6839\u636e\u8bbf\u95ee\u57df\u540d\u5339\u914d\u5bf9\u5e94\u914d\u7f6e<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u5de5\u4f5c\u539f\u7406<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u7528\u6237\u8bbf\u95ee\u535a\u5ba2\u65f6<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n1. \u8f93\u5165: www.example.com\n2. DNS: www.example.com \u2192 YOUR_SERVER_IP\n3. \u8bf7\u6c42: YOUR_SERVER_IP:80 (Host: www.example.com)\n4. Nginx: \u5339\u914d server_name www.example.com\n5. \u8fd4\u56de: WordPress \u535a\u5ba2\u5185\u5bb9\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u7528\u6237\u8bbf\u95ee\u9910\u5385\u7cfb\u7edf\u65f6<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n1. \u8f93\u5165: restaurant.example.com\n2. DNS: restaurant.example.com \u2192 YOUR_SERVER_IP (\u540c\u4e00\u4e2aIP)\n3. \u8bf7\u6c42: YOUR_SERVER_IP:80 (Host: restaurant.example.com)\n4. Nginx: \u5339\u914d server_name restaurant.example.com\n5. \u8fd4\u56de: \u9910\u5385\u7cfb\u7edf\u5185\u5bb9\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u6700\u7ec8\u8bbf\u95ee\u5730\u5740<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>WordPress \u535a\u5ba2<\/strong>:\u00a0<code class=\"\">https:\/\/www.example.com<\/code><\/li>\n\n\n\n<li><strong>\u9910\u5385\u9884\u8ba2\u7cfb\u7edf<\/strong>:\u00a0<code class=\"\">http:\/\/restaurant.example.com<\/code><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6848\u4f18\u52bf<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u96f6\u6210\u672c<\/strong>\uff1a\u65e0\u9700\u8d2d\u4e70\u65b0\u670d\u52a1\u5668\uff0c\u65e0\u9700\u989d\u5916\u57df\u540d\uff08\u4f7f\u7528\u5b50\u57df\u540d\uff09<\/li>\n\n\n\n<li><strong>\u6807\u51c6\u5316<\/strong>\uff1a\u4f7f\u7528\u6807\u51c6 80\/443 \u7aef\u53e3\uff0c\u65e0\u9700\u7aef\u53e3\u53f7<\/li>\n\n\n\n<li><strong>\u6613\u7ef4\u62a4<\/strong>\uff1a\u4e24\u4e2a\u7cfb\u7edf\u72ec\u7acb\u914d\u7f6e\uff0c\u4e92\u4e0d\u5f71\u54cd<\/li>\n\n\n\n<li><strong>\u53ef\u6269\u5c55<\/strong>\uff1a\u53ef\u7ee7\u7eed\u6dfb\u52a0\u66f4\u591a\u5b50\u57df\u540d\u9879\u76ee<\/li>\n\n\n\n<li><strong>\u4e13\u4e1a\u6027<\/strong>\uff1a\u7b26\u5408\u6807\u51c6 Web \u8bbf\u95ee\u89c4\u8303<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u53ef\u9009\u4f18\u5316<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u914d\u7f6e HTTPS\uff08\u63a8\u8350\uff09<\/h3>\n\n\n\n<p><strong>\u4f7f\u7528 certbot \u81ea\u52a8\u914d\u7f6e<\/strong>\uff1a<\/p>\n\n\n\n<p><strong>bash<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncertbot --nginx -d restaurant.example.com\n\n<\/pre><\/div>\n\n\n<p><strong>\u6216\u4f7f\u7528\u5b9d\u5854\u9762\u677f<\/strong>\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u7f51\u7ad9 \u2192 restaurant.example.com \u2192 SSL \u2192 Let's Encrypt \u2192 \u7533\u8bf7\n\n<\/pre><\/div>\n\n\n<p>\u914d\u7f6e\u540e\u8bbf\u95ee\uff1a&nbsp;<code class=\"\">https:\/\/restaurant.example.com<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6e05\u7406\u65e7\u914d\u7f6e\uff08\u53ef\u9009\uff09<\/h3>\n\n\n\n<p>\u5173\u95ed\u4e0d\u518d\u4f7f\u7528\u7684 8081 \u7aef\u53e3\uff1a<\/p>\n\n\n\n<p><strong>bash<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfirewall-cmd --permanent --remove-port=8081\/tcp\nfirewall-cmd --reload\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u6392\u67e5\u6e05\u5355<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">DNS \u68c0\u67e5<\/h3>\n\n\n\n<p><strong>bash<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nnslookup restaurant.example.com\n# \u5e94\u8fd4\u56de: YOUR_SERVER_IP\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Nginx \u68c0\u67e5<\/h3>\n\n\n\n<p><strong>bash<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nnginx -t  # \u914d\u7f6e\u8bed\u6cd5\u68c0\u67e5\nnetstat -tlnp | grep :80  # \u7aef\u53e3\u76d1\u542c\u68c0\u67e5\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u8bbf\u95ee\u68c0\u67e5<\/h3>\n\n\n\n<p><strong>bash<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncurl -I http:\/\/restaurant.example.com\n# \u5e94\u8fd4\u56de: HTTP\/1.1 200 OK\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u6d4f\u89c8\u5668\u68c0\u67e5<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2705 \u8bbf\u95ee\u00a0<code class=\"\">http:\/\/restaurant.example.com<\/code>\u00a0\u663e\u793a\u767b\u5f55\u9875\u9762<\/li>\n\n\n\n<li>\u2705 F12 Console \u65e0\u9519\u8bef<\/li>\n\n\n\n<li>\u2705 Network \u6807\u7b7e\u8d44\u6e90\u52a0\u8f7d\u6b63\u5e38<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u6280\u672f\u8981\u70b9\u603b\u7ed3<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u540c IP \u591a\u57df\u540d<\/strong>\uff1a\u4e00\u4e2a\u670d\u52a1\u5668 IP \u53ef\u4ee5\u7ed1\u5b9a\u65e0\u9650\u4e2a\u57df\u540d<\/li>\n\n\n\n<li><strong>\u540c\u7aef\u53e3\u591a\u7f51\u7ad9<\/strong>\uff1a80 \u7aef\u53e3\u53ef\u4ee5\u670d\u52a1\u591a\u4e2a\u7f51\u7ad9\uff08\u901a\u8fc7\u57df\u540d\u533a\u5206\uff09<\/li>\n\n\n\n<li><strong>HTTP Host \u5934<\/strong>\uff1a\u6d4f\u89c8\u5668\u8bf7\u6c42\u65f6\u4f1a\u5e26\u4e0a\u57df\u540d\uff0cNginx \u636e\u6b64\u8def\u7531<\/li>\n\n\n\n<li><strong>\u65e0\u9700\u4ee3\u7801\u4fee\u6539<\/strong>\uff1a\u524d\u7aef\u4ee3\u7801\u65e0\u9700\u6539\u52a8\uff0c\u81ea\u7136\u9002\u914d\u57df\u540d\u8bbf\u95ee<\/li>\n\n\n\n<li><strong>DNS \u5b50\u57df\u540d<\/strong>\uff1a\u4f7f\u7528\u4e3b\u57df\u540d\u7684\u5b50\u57df\u540d\uff0c\u65e0\u9700\u989d\u5916\u8d2d\u4e70<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\u80cc\u666f \u89e3\u51b3\u65b9\u6848\uff1a\u540c IP \u540c\u7aef\u53e3 + \u4e0d\u540c\u57df\u540d \u6838\u5fc3\u539f\u7406 \u901a\u8fc7 Nginx \u7684&nbsp;server_n &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zcc609.online\/?p=107\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;\u591a\u9879\u76ee\u5171\u5b58\u90e8\u7f72\u65b9\u6848 &#8211; WordPress\u535a\u5ba2\u4e0e\u9910\u5385\u9884\u8ba2\u7cfb\u7edf\uff08\u540c\u4e00\u63a5\u53e3\u4e0d\u540c\u57df\u540d\uff09&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/zcc609.online\/index.php?rest_route=\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zcc609.online\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zcc609.online\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zcc609.online\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zcc609.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107"}],"version-history":[{"count":1,"href":"https:\/\/zcc609.online\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/zcc609.online\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions\/108"}],"wp:attachment":[{"href":"https:\/\/zcc609.online\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zcc609.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zcc609.online\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}