{"id":1163,"date":"2022-10-21T00:59:00","date_gmt":"2022-10-21T00:59:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=1163"},"modified":"2022-10-21T00:59:00","modified_gmt":"2022-10-21T00:59:00","slug":"1163","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2022\/10\/21\/1163\/","title":{"rendered":"\u4f7f\u7528Nginx\u53cd\u5411\u4ee3\u7406\uff0c\u5b89\u5168\u7ba1\u7406\u5bb6\u91cc\u7684\u8def\u7531\u5668"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/10\/3129359021.webp\" alt=\"2.webp\" title=\"2.webp\"><\/p>\n<h3>1. \u9996\u5148\u4f60\u8981\u6709\u4e00\u4e2a\u80fd\u5b89\u88c5nginx\u670d\u52a1\u5668\u7684\u8bbe\u5907\uff0c\u63a8\u8350\u80fd\u5237Armbian\u7684\u5c0f\u76d2\u5b50\uff0c N1 \u73a9\u5ba2\u4e91 \u7535\u89c6\u76d2\u5f88\u591a<\/h3>\n<h3>2. \u5237\u597dlinux\u7cfb\u7edf\uff0c\u8bbe\u7f6e\u597dDDNS\uff0c\u53c2\u8003  <a href=\"https:\/\/hostloc.com\/thread-1073400-1-1.html\">https:\/\/hostloc.com\/thread-1073400-1-1.html<\/a><\/h3>\n<pre><code>    cf-v4-ddns.sh \u811a\u672c\uff0c\u6bcf15\u5206\u949f\u8fd0\u884c\u4e00\u6b21\uff0c\u8bbe\u7f6e\u4e5f\u633a\u7b80\u5355\n\n    *\/15 * * * * bash \/root\/cf-v4-ddns.sh\n\n    \u767b\u5f55 CF\uff0c\u5b89\u5168\u8bbe\u7f6e\u91cc\uff0c\u83b7\u5f97 API KEY\uff0c\u4fee\u6539\u5230 cf-v4-ddns.sh\u91cc\n\n    # Username, eg: user@example.com\n    CFUSER=cf\u5e10\u53f7@gmail.com\n\n    # Zone name, eg: example.com\n    CFZONE_NAME=\u57df\u540d.net\n\n    # Hostname to update, eg: homeserver.example.com\n    CFRECORD_NAME=\u4e8c\u7ea7.\u57df\u540d.net\n    \u590d\u5236\u4ee3\u7801<\/code><\/pre>\n<h3>3. linux \u5b89\u88c5 nginx\uff0c\u901a\u8fc7\u6d4f\u89c8\u5668\u80fd\u6b63\u5e38\u8bbf\u95ee\uff0c\u518d\u5728\u8def\u7531\u5668\u4e2d\u7aef\u53e3\u6620\u5c04\u51fa\u53bb\uff0c\u987a\u4fbf\u628a 10086 \u8fd9\u4e2a\u7aef\u53e3\u4e5f\u6620\u5c04\u51fa\u53bb\uff0c\u5f53\u4f5c\u516c\u7f51\u7ba1\u7406\u8def\u7531\u5668\u4e13\u7528\u7aef\u53e3<\/h3>\n<h3>4. \u8fdb\u5165 \/etc\/nginx\/sites-enabled   \u76ee\u5f55\u5efa\u7acb  gateway.conf<\/h3>\n<pre><code>server {\n        listen 10086 default_server;\n        client_max_body_size 256m;\n        index index.html index.php index.nginx-debian.html;\n        server_name _;\n\n        location \/ {\n                proxy_pass http:\/\/192.168.1.1;\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                proxy_set_header X-Forwarded-Protocol $scheme;\n                proxy_set_header X-Forwarded-Host $http_host;\n\n                proxy_buffering off;\n        }\n}<\/code><\/pre>\n<h3>5.  \u6d4b\u8bd5nginx\u914d\u7f6e\u662f\u5426\u6b63\u786e\uff0c\u91cd\u542fnginx\u670d\u52a1\u5668<\/h3>\n<pre><code>nginx -t\nnginx -s reload\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/10\/3299993504.webp\" alt=\"nginx.conf.webp\" title=\"nginx.conf.webp\"><\/p>\n<h3>\u5982\u56fe\uff0c\u4f7f\u7528\u4e00\u4e2a\u7aef\u53e3\u4e13\u95e8\u53cd\u4ee3\u8def\u7531\u5668\u7ba1\u7406\u8fd9\u79cd\u6709URL\u8df3\u8f6c\u7684\u6bd4\u8f83\u65b9\u4fbf<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/10\/567360589.png\" alt=\"xxx.png\" title=\"xxx.png\"><\/p>\n<h3>Nginx \u8fd8\u6709\u4e00\u4e9b\u4f7f\u7528\u76ee\u5f55\u53cd\u4ee3\u670d\u52a1\uff0c\u90a3\u6837\u4e0d\u7528\u540e\u8ddf\u4e00\u4e2a\u7aef\u53e3\u5c0f\u5c3e\u5df4\uff0c\u4f46\u662f\u4e0d\u9002\u5408\u9762\u677f\u7ba1\u7406\u6709\u8df3\u8f6c\u7684\u60c5\u51b5<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>1. \u9996\u5148\u4f60\u8981\u6709\u4e00\u4e2a\u80fd\u5b89\u88c5nginx\u670d\u52a1\u5668\u7684\u8bbe\u5907\uff0c\u63a8\u8350\u80fd\u5237Armbian\u7684\u5c0f\u76d2\u5b50\uff0c N1 \u73a9\u5ba2\u4e91 \u7535 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[17],"class_list":["post-1163","post","type-post","status-publish","format-standard","hentry","category-linux","tag-vps"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=1163"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1163\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}