{"id":86655,"date":"2026-07-28T23:49:52","date_gmt":"2026-07-28T15:49:52","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/86655.html"},"modified":"2026-07-28T23:49:52","modified_gmt":"2026-07-28T15:49:52","slug":"%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%8d%87%e7%ba%a7nginx","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/86655.html","title":{"rendered":"\u670d\u52a1\u5668\u5347\u7ea7nginx"},"content":{"rendered":"<p>\u76ee\u524d\u6709\u4e09\u4e2a\u89e3\u51b3\u65b9\u6848<\/p>\n<p>\u4f46\u662f\u6240\u6709\u65b9\u6848\u524d\u5c3d\u91cf\u6267\u884c\u4e00\u4e0b\u6307\u4ee4\u8fdb\u884c\u57fa\u7840\u914d\u7f6e<\/p>\n<p># \u4f7f\u7528sudo\u6743\u9650\u6d4b\u8bd5nginx\u914d\u7f6e<br \/>\nsudo nginx -t<\/p>\n<p># \u68c0\u67e5nginx\u670d\u52a1\u72b6\u6001<br \/>\nsudo systemctl status nginx<\/p>\n<p># \u5907\u4efdnginx\u914d\u7f6e<br \/>\nsudo cp -r \/etc\/nginx \/etc\/nginx-backup-1.18<\/p>\n<p># \u5907\u4efd\u7f16\u8bd1\u53c2\u6570&#xff08;\u91cd\u8981&#xff01;&#xff09;<br \/>\nnginx -V &gt; ~\/nginx-1.18-compile-options.txt<\/p>\n<p># \u5b89\u88c5\u5fc5\u8981\u7684\u5de5\u5177<br \/>\nsudo apt update<br \/>\nsudo apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring<\/p>\n<p># \u5bfc\u5165Nginx\u5b98\u65b9\u7b7e\u540d\u5bc6\u94a5<br \/>\ncurl https:\/\/nginx.org\/keys\/nginx_signing.key | gpg &#8211;dearmor | sudo tee \/usr\/share\/keyrings\/nginx-archive-keyring.gpg &gt;\/dev\/null<\/p>\n<p># \u6dfb\u52a0Nginx\u5b98\u65b9\u6e90<br \/>\necho &#034;deb [signed-by&#061;\/usr\/share\/keyrings\/nginx-archive-keyring.gpg] http:\/\/nginx.org\/packages\/ubuntu &#096;lsb_release -cs&#096; nginx&#034; | sudo tee \/etc\/apt\/sources.list.d\/nginx.list<\/p>\n<p># \u8bbe\u7f6e\u4f18\u5148\u7ea7&#xff0c;\u4f18\u5148\u4f7f\u7528Nginx\u5b98\u65b9\u6e90<br \/>\necho -e &#034;Package: *\\\\nPin: origin nginx.org\\\\nPin-Priority: 900&#034; | sudo tee \/etc\/apt\/preferences.d\/99nginx<\/p>\n<p># \u66f4\u65b0\u5305\u5217\u8868<br \/>\nsudo apt update<\/p>\n<p>\u4e00\u4e0b\u6307\u4ee4\u6839\u636e\u9700\u8981\u8fdb\u884c\u6267\u884c\u64cd\u4f5c<\/p>\n<p>sudo systemctl stop nginx<br \/>\nsudo systemctl status nginx<\/p>\n<\/p>\n<p># \u67e5\u770b\u53ef\u7528\u7684Nginx\u7248\u672c<br \/>\napt-cache policy nginx<\/p>\n<p># \u5347\u7ea7Nginx\u5230\u6700\u65b0\u7a33\u5b9a\u7248&#xff08;1.28&#xff09;<br \/>\nsudo apt install nginx<\/p>\n<p>nginx -v<br \/>\nsudo nginx -v<\/p>\n<h3>\u65b9\u6848\u4e00&#xff1a;\u4f7f\u7528\u52a8\u6001\u6a21\u5757\u70ed\u52a0\u8f7d<\/h3>\n<\/p>\n<p>#!\/bin\/bash<\/p>\n<p># Nginx\u70ed\u5347\u7ea7\u811a\u672c &#8211; \u65e0\u9700\u91cd\u542f\u670d\u52a1<br \/>\nset -e<\/p>\n<p>echo &#034;\u5f00\u59cbNginx\u70ed\u5347\u7ea7&#8230;&#034;<\/p>\n<p># \u5907\u4efd\u5f53\u524dNginx\u4e8c\u8fdb\u5236\u6587\u4ef6<br \/>\nsudo cp \/usr\/sbin\/nginx \/usr\/sbin\/nginx.backup.1.18.0<\/p>\n<p># \u4e0b\u8f7d\u5e76\u7f16\u8bd1Nginx 1.28<br \/>\ncd \/tmp<br \/>\nwget http:\/\/nginx.org\/download\/nginx-1.28.0.tar.gz<br \/>\ntar -zxvf nginx-1.28.0.tar.gz<br \/>\ncd nginx-1.28.0<\/p>\n<p># \u4f7f\u7528\u4e0e\u5f53\u524d\u7248\u672c\u76f8\u540c\u7684\u914d\u7f6e\u53c2\u6570<br \/>\n\u53ef\u4ee5\u6267\u884c\u6307\u4ee4nginx -V &gt; ~\/nginx-1.18-compile-options.txt\u67e5\u770b<\/p>\n<p># \u53ea\u7f16\u8bd1\u4e0d\u5b89\u88c5<br \/>\nmake<\/p>\n<p># \u5907\u4efd\u5f53\u524dNginx<br \/>\nsudo mv \/usr\/sbin\/nginx \/usr\/sbin\/nginx.old<\/p>\n<p># \u5b89\u88c5\u65b0\u7248\u672c\u4e8c\u8fdb\u5236\u6587\u4ef6<br \/>\nsudo cp objs\/nginx \/usr\/sbin\/nginx<\/p>\n<p># \u6d4b\u8bd5\u65b0\u7248\u672c<br \/>\nsudo \/usr\/sbin\/nginx -t<\/p>\n<p># \u5411\u4e3b\u8fdb\u7a0b\u53d1\u9001USR2\u4fe1\u53f7&#xff0c;\u542f\u52a8\u65b0\u7684\u4e3b\u8fdb\u7a0b<br \/>\nsudo kill -USR2 $(cat \/run\/nginx.pid)<\/p>\n<p># \u7b49\u5f85\u65b0\u8fdb\u7a0b\u542f\u52a8<br \/>\nsleep 5<\/p>\n<p># \u5411\u65e7\u4e3b\u8fdb\u7a0b\u53d1\u9001WINCH\u4fe1\u53f7&#xff0c;\u4f18\u96c5\u5173\u95ed\u65e7\u5de5\u4f5c\u8fdb\u7a0b<br \/>\nsudo kill -WINCH $(cat \/run\/nginx.pid.oldbin 2&gt;\/dev\/null) 2&gt;\/dev\/null || true<\/p>\n<p># \u68c0\u67e5\u65b0\u7248\u672c\u662f\u5426\u6b63\u5e38\u8fd0\u884c<br \/>\necho &#034;\u68c0\u67e5\u65b0\u7248\u672c\u72b6\u6001&#8230;&#034;<br \/>\nsudo nginx -v<br \/>\nsudo systemctl status nginx<\/p>\n<p>echo &#034;\u70ed\u5347\u7ea7\u5b8c\u6210&#xff01;\u65e7\u8fdb\u7a0b\u4ecd\u5728\u8fd0\u884c&#xff0c;\u53ef\u4ee5\u968f\u65f6\u56de\u6eda\u3002&#034;<br \/>\necho &#034;\u5982\u679c\u4e00\u5207\u6b63\u5e38&#xff0c;\u53ef\u4ee5\u5b89\u5168\u7ec8\u6b62\u65e7\u8fdb\u7a0b&#xff1a;sudo kill -QUIT $(cat \/run\/nginx.pid.oldbin)&#034;<br \/>\n\u00a0<\/p>\n<h3>\u65b9\u6848\u4e8c&#xff1a;\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u4f46\u907f\u514d\u91cd\u542f<\/h3>\n<p>#!\/bin\/bash<\/p>\n<p># \u65e0\u91cd\u542fNginx\u5347\u7ea7\u65b9\u6848<br \/>\necho &#034;Nginx\u65e0\u91cd\u542f\u5347\u7ea7\u65b9\u6848&#8230;&#034;<\/p>\n<p># 1. \u9996\u5148\u68c0\u67e5\u5f53\u524d\u670d\u52a1\u72b6\u6001<br \/>\necho &#034;\u5f53\u524dNginx\u72b6\u6001&#xff1a;&#034;<br \/>\nsudo systemctl status nginx &#8211;no-pager<\/p>\n<p># 2. \u5b89\u88c5\u65b0\u7248\u672c\u4f46\u4e0d\u91cd\u542f<br \/>\nsudo apt update<br \/>\nsudo apt install -y nginx &#8211;no-install-recommends<\/p>\n<p># 3. \u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e&#xff08;\u4e0d\u91cd\u542f\u670d\u52a1&#xff09;<br \/>\necho &#034;\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e&#8230;&#034;<br \/>\nsudo nginx -t &amp;&amp; sudo nginx -s reload<\/p>\n<p># 4. \u9a8c\u8bc1\u7248\u672c\u5347\u7ea7<br \/>\necho &#034;\u5f53\u524d\u8fd0\u884c\u7684Nginx\u7248\u672c&#xff1a;&#034;<br \/>\nnginx -v 2&gt;&amp;1<\/p>\n<p>echo &#034;\u7cfb\u7edf\u5b89\u88c5\u7684Nginx\u7248\u672c&#xff1a;&#034;<br \/>\n\/usr\/sbin\/nginx -v 2&gt;&amp;1<\/p>\n<p># 5. \u68c0\u67e5\u670d\u52a1\u662f\u5426\u6b63\u5e38<br \/>\necho &#034;\u670d\u52a1\u72b6\u6001\u68c0\u67e5&#xff1a;&#034;<br \/>\nsudo systemctl status nginx &#8211;no-pager<\/p>\n<p># 6. \u9a8c\u8bc1\u7f51\u7ad9\u8bbf\u95ee<br \/>\necho &#034;\u6d4b\u8bd5\u7f51\u7ad9\u54cd\u5e94&#xff1a;&#034;<br \/>\ncurl -I http:\/\/localhost -m 5 || echo &#034;HTTP\u6d4b\u8bd5\u5931\u8d25&#034;<br \/>\ncurl -I https:\/\/localhost -k -m 5 2&gt;\/dev\/null || echo &#034;HTTPS\u6d4b\u8bd5\u5931\u8d25&#034;<\/p>\n<p>echo &#034;\u5347\u7ea7\u5b8c\u6210&#xff01;\u670d\u52a1\u672a\u91cd\u542f&#xff0c;\u4f46\u65b0\u7248\u672c\u5df2\u5c31\u4f4d\u3002&#034;<br \/>\necho &#034;\u6ce8\u610f&#xff1a;\u4e0b\u6b21\u91cd\u542f\u670d\u52a1\u65f6\u4f1a\u4f7f\u7528\u65b0\u7248\u672c\u3002&#034;<br \/>\n\u00a0<\/p>\n<\/p>\n<h3>\u65b9\u6848\u4e09&#xff1a;\u914d\u7f6e\u68c0\u67e5\u548c\u4f18\u5316&#xff08;\u65e0\u9700\u5347\u7ea7\u7248\u672c&#xff09;<\/h3>\n<p>#!\/bin\/bash<\/p>\n<p># Nginx\u914d\u7f6e\u4f18\u5316\u548c\u5b89\u5168\u52a0\u56fa&#xff08;\u4e0d\u5347\u7ea7\u7248\u672c&#xff09;<br \/>\necho &#034;\u5f00\u59cb\u4f18\u5316Nginx\u914d\u7f6e&#8230;&#034;<\/p>\n<p># \u5907\u4efd\u5f53\u524d\u914d\u7f6e<br \/>\nsudo cp \/etc\/nginx\/nginx.conf \/etc\/nginx\/nginx.conf.backup.$(date &#043;%Y%m%d)<\/p>\n<p># 1. \u5b89\u5168\u5934\u914d\u7f6e<br \/>\nsudo tee \/etc\/nginx\/conf.d\/security_headers.conf &gt; \/dev\/null &lt;&lt;&#039;EOF&#039;<br \/>\n# \u5b89\u5168\u5934\u90e8\u914d\u7f6e<br \/>\nadd_header X-Frame-Options &#034;SAMEORIGIN&#034; always;<br \/>\nadd_header X-XSS-Protection &#034;1; mode&#061;block&#034; always;<br \/>\nadd_header X-Content-Type-Options &#034;nosniff&#034; always;<br \/>\nadd_header Referrer-Policy &#034;strict-origin-when-cross-origin&#034; always;<br \/>\nadd_header Content-Security-Policy &#034;default-src &#039;self&#039; http: https: data: blob: &#039;unsafe-inline&#039;&#034; always;<br \/>\nEOF<\/p>\n<p># 2. SSL\u4f18\u5316\u914d\u7f6e<br \/>\nsudo tee \/etc\/nginx\/conf.d\/ssl_optimize.conf &gt; \/dev\/null &lt;&lt;&#039;EOF&#039;<br \/>\n# SSL\u4f18\u5316\u914d\u7f6e<br \/>\nssl_protocols TLSv1.2 TLSv1.3;<br \/>\nssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;<br \/>\nssl_prefer_server_ciphers on;<br \/>\nssl_session_cache shared:SSL:10m;<br \/>\nssl_session_timeout 10m;<br \/>\nEOF<\/p>\n<p># 3. \u6027\u80fd\u4f18\u5316\u914d\u7f6e<br \/>\nsudo tee \/etc\/nginx\/conf.d\/performance.conf &gt; \/dev\/null &lt;&lt;&#039;EOF&#039;<br \/>\n# \u6027\u80fd\u4f18\u5316<br \/>\nclient_max_body_size 100M;<br \/>\nclient_body_timeout 30;<br \/>\nclient_header_timeout 30;<br \/>\nkeepalive_timeout 65;<br \/>\nsend_timeout 30;<br \/>\nsendfile on;<br \/>\ntcp_nopush on;<br \/>\ntcp_nodelay on;<br \/>\ntypes_hash_max_size 2048;<br \/>\nserver_tokens off;<br \/>\nEOF<\/p>\n<p># 4. \u68c0\u67e5\u914d\u7f6e\u8bed\u6cd5<br \/>\necho &#034;\u68c0\u67e5\u914d\u7f6e\u8bed\u6cd5&#8230;&#034;<br \/>\nsudo nginx -t<\/p>\n<p>if [ $? -eq 0 ]; then<br \/>\n\u00a0 \u00a0 # 5. \u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<br \/>\n\u00a0 \u00a0 echo &#034;\u91cd\u65b0\u52a0\u8f7dNginx\u914d\u7f6e&#8230;&#034;<br \/>\n\u00a0 \u00a0 sudo nginx -s reload<br \/>\n\u00a0 \u00a0 echo &#034;\u914d\u7f6e\u4f18\u5316\u5b8c\u6210&#xff01;&#034;<br \/>\nelse<br \/>\n\u00a0 \u00a0 echo &#034;\u914d\u7f6e\u8bed\u6cd5\u9519\u8bef&#xff0c;\u5df2\u56de\u6eda&#8230;&#034;<br \/>\n\u00a0 \u00a0 sudo cp \/etc\/nginx\/nginx.conf.backup.$(date &#043;%Y%m%d) \/etc\/nginx\/nginx.conf<br \/>\nfi<\/p>\n<p># 6. \u9a8c\u8bc1\u4f18\u5316\u6548\u679c<br \/>\necho &#034;\u5f53\u524dNginx\u914d\u7f6e\u72b6\u6001&#xff1a;&#034;<br \/>\nsudo nginx -T | grep -E &#034;(add_header|ssl_|client_|keepalive)&#034; | head -20<br \/>\n\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u524d\u6709\u4e09\u4e2a\u89e3\u51b3\u65b9\u6848\u4f46\u662f\u6240\u6709\u65b9\u6848\u524d\u5c3d\u91cf\u6267\u884c\u4e00\u4e0b\u6307\u4ee4\u8fdb\u884c\u57fa\u7840\u914d\u7f6e# \u4f7f\u7528sudo\u6743\u9650\u6d4b\u8bd5nginx\u914d\u7f6e<br \/>\nsudo nginx -t# \u68c0\u67e5nginx\u670d\u52a1\u72b6\u6001<br \/>\nsudo systemctl status nginx# \u5907\u4efdnginx\u914d\u7f6e<br \/>\nsudo cp -r \/etc\/nginx \/etc\/nginx-backup-1.18# \u5907\u4efd\u7f16\u8bd1\u53c2\u6570&#xff08;\u91cd\u8981&#xff01;&#xff09;<br \/>\nnginx -V &gt; ~\/nginx-1.18-compile-options.txt# <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[117,5388,43],"topic":[],"class_list":["post-86655","post","type-post","status-publish","format-standard","hentry","category-server","tag-nginx","tag-xcode","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u670d\u52a1\u5668\u5347\u7ea7nginx - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/86655.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u670d\u52a1\u5668\u5347\u7ea7nginx - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u524d\u6709\u4e09\u4e2a\u89e3\u51b3\u65b9\u6848\u4f46\u662f\u6240\u6709\u65b9\u6848\u524d\u5c3d\u91cf\u6267\u884c\u4e00\u4e0b\u6307\u4ee4\u8fdb\u884c\u57fa\u7840\u914d\u7f6e# \u4f7f\u7528sudo\u6743\u9650\u6d4b\u8bd5nginx\u914d\u7f6e sudo nginx -t# \u68c0\u67e5nginx\u670d\u52a1\u72b6\u6001 sudo systemctl status nginx# \u5907\u4efdnginx\u914d\u7f6e sudo cp -r \/etc\/nginx \/etc\/nginx-backup-1.18# \u5907\u4efd\u7f16\u8bd1\u53c2\u6570&#xff08;\u91cd\u8981&#xff01;&#xff09; nginx -V &gt; ~\/nginx-1.18-compile-options.txt#\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/86655.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-28T15:49:52+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86655.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/86655.html\",\"name\":\"\u670d\u52a1\u5668\u5347\u7ea7nginx - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-28T15:49:52+00:00\",\"dateModified\":\"2026-07-28T15:49:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/86655.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/86655.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86655.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u670d\u52a1\u5668\u5347\u7ea7nginx\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u670d\u52a1\u5668\u5347\u7ea7nginx - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/86655.html","og_locale":"zh_CN","og_type":"article","og_title":"\u670d\u52a1\u5668\u5347\u7ea7nginx - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u524d\u6709\u4e09\u4e2a\u89e3\u51b3\u65b9\u6848\u4f46\u662f\u6240\u6709\u65b9\u6848\u524d\u5c3d\u91cf\u6267\u884c\u4e00\u4e0b\u6307\u4ee4\u8fdb\u884c\u57fa\u7840\u914d\u7f6e# \u4f7f\u7528sudo\u6743\u9650\u6d4b\u8bd5nginx\u914d\u7f6e sudo nginx -t# \u68c0\u67e5nginx\u670d\u52a1\u72b6\u6001 sudo systemctl status nginx# \u5907\u4efdnginx\u914d\u7f6e sudo cp -r \/etc\/nginx \/etc\/nginx-backup-1.18# \u5907\u4efd\u7f16\u8bd1\u53c2\u6570&#xff08;\u91cd\u8981&#xff01;&#xff09; nginx -V &gt; ~\/nginx-1.18-compile-options.txt#","og_url":"https:\/\/www.wsisp.com\/helps\/86655.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-28T15:49:52+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/86655.html","url":"https:\/\/www.wsisp.com\/helps\/86655.html","name":"\u670d\u52a1\u5668\u5347\u7ea7nginx - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-28T15:49:52+00:00","dateModified":"2026-07-28T15:49:52+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/86655.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/86655.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/86655.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u670d\u52a1\u5668\u5347\u7ea7nginx"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=86655"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86655\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=86655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=86655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=86655"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=86655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}