{"id":99396,"date":"2026-09-02T15:04:30","date_gmt":"2026-09-02T07:04:30","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/99396.html"},"modified":"2026-09-02T15:04:30","modified_gmt":"2026-09-02T07:04:30","slug":"nginx%e5%a6%82%e4%bd%95%e8%ae%a9%e5%a4%9a%e4%b8%aa%e7%bd%91%e7%ab%99%e7%bb%91%e5%ae%9a%e4%b8%8d%e5%90%8cip%ef%bc%9alisten%e9%85%8d%e7%bd%ae%e3%80%81%e9%aa%8c%e8%af%81%e4%b8%8e%e5%b8%b8%e8%a7%81","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/99396.html","title":{"rendered":"Nginx\u5982\u4f55\u8ba9\u591a\u4e2a\u7f51\u7ad9\u7ed1\u5b9a\u4e0d\u540cIP\uff1alisten\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u5e38\u89c1\u6545\u969c"},"content":{"rendered":"<p>\u4e00\u53f0Linux\u670d\u52a1\u5668\u914d\u7f6e\u591a\u4e2aIPv4\u540e&#xff0c;\u5e38\u89c1\u9700\u6c42\u662f\u8ba9\u4e0d\u540c\u7f51\u7ad9\u5206\u522b\u76d1\u542c\u4e0d\u540cIP&#xff0c;\u800c\u4e0d\u662f\u8ba9\u6240\u6709\u7ad9\u70b9\u5171\u540c\u76d1\u542c 0.0.0.0:80\u3002Nginx\u53ef\u4ee5\u901a\u8fc7 listen IP:\u7aef\u53e3 \u5b9e\u73b0IP\u7ea7\u76d1\u542c&#xff0c;\u518d\u4f7f\u7528 server_name \u5339\u914d\u57df\u540d\u3002<\/p>\n<p>\u672c\u6587\u4f7f\u7528\u6587\u6863\u793a\u4f8b\u5730\u5740 192.0.2.10 \u548c 198.51.100.20\u3002\u5b83\u4eec\u4e0d\u80fd\u7528\u4e8e\u751f\u4ea7\u7f51\u7edc&#xff0c;\u8bf7\u66ff\u6362\u6210\u670d\u52a1\u5668\u5b9e\u9645\u5206\u914d\u7684IP\u3002<\/p>\n<h3>\u4e00\u3001\u5148\u7406\u89e3 listen \u548c server_name \u7684\u5206\u5de5<\/h3>\n<ul>\n<li>listen \u51b3\u5b9aNginx\u5728\u54ea\u4e2a\u672c\u5730\u5730\u5740\u548c\u7aef\u53e3\u63a5\u6536\u8fde\u63a5&#xff1b;<\/li>\n<li>server_name \u6839\u636eHTTP\u8bf7\u6c42\u4e2d\u7684\u4e3b\u673a\u540d\u9009\u62e9\u865a\u62df\u4e3b\u673a&#xff1b;<\/li>\n<li>root\u3001proxy_pass \u7b49\u6307\u4ee4\u51b3\u5b9a\u8bf7\u6c42\u6700\u7ec8\u8bfb\u53d6\u6587\u4ef6\u8fd8\u662f\u8f6c\u53d1\u5230\u540e\u7aef\u3002<\/li>\n<\/ul>\n<p>\u53ea\u5199\u4e0b\u9762\u8fd9\u79cd\u914d\u7f6e\u65f6&#xff0c;Nginx\u4f1a\u76d1\u542c\u672c\u673a\u6240\u6709IPv4\u5730\u5740\u768480\u7aef\u53e3&#xff1a;<\/p>\n<p>listen 80;<\/p>\n<p>\u5982\u679c\u5e0c\u671b\u67d0\u4e2a\u7ad9\u70b9\u53ea\u76d1\u542c\u6307\u5b9aIP&#xff0c;\u5e94\u5199\u51fa\u5b8c\u6574\u5730\u5740&#xff1a;<\/p>\n<p>listen 192.0.2.10:80;<\/p>\n<h3>\u4e8c\u3001\u914d\u7f6e\u524d\u786e\u8ba4IP\u5df2\u7ecf\u7ed1\u5b9a\u5230\u7cfb\u7edf<\/h3>\n<p>Nginx\u53ea\u80fd\u76d1\u542c\u64cd\u4f5c\u7cfb\u7edf\u5df2\u7ecf\u62e5\u6709\u7684\u5730\u5740\u3002\u5148\u68c0\u67e5\u7f51\u5361&#xff1a;<\/p>\n<p><span class=\"token function\">ip<\/span> <span class=\"token parameter variable\">-4<\/span> addr show<br \/>\n<span class=\"token function\">ip<\/span> route<\/p>\n<p>\u5e94\u5f53\u80fd\u770b\u5230\u8ba1\u5212\u4f7f\u7528\u7684\u5168\u90e8\u516c\u7f51IP&#xff0c;\u4ee5\u53ca\u6b63\u786e\u7684\u524d\u7f00\u3001\u7f51\u5173\u548c\u8def\u7531\u3002\u5982\u679cIP\u5c1a\u672a\u914d\u7f6e&#xff0c;\u76f4\u63a5\u6267\u884c nginx -t \u53ef\u80fd\u901a\u8fc7&#xff0c;\u4f46\u542f\u52a8\u6216\u91cd\u8f7d\u65f6\u53ef\u80fd\u51fa\u73b0&#xff1a;<\/p>\n<p>bind() to 192.0.2.10:80 failed (99: Cannot assign requested address)<\/p>\n<p>\u8fd9\u79cd\u60c5\u51b5\u8981\u5148\u4fee\u6b63\u7cfb\u7edf\u7f51\u7edc\u914d\u7f6e&#xff0c;\u800c\u4e0d\u662f\u53cd\u590d\u4fee\u6539Nginx\u3002<\/p>\n<h3>\u4e09\u3001\u8ba9\u4e24\u4e2a\u7ad9\u70b9\u5206\u522b\u7ed1\u5b9a\u4e24\u4e2aIP<\/h3>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<table>\n<tr>\u7f51\u7ad9\u76d1\u542cIP\u7ad9\u70b9\u76ee\u5f55<\/tr>\n<tbody>\n<tr>\n<td>site-a.example<\/td>\n<td>192.0.2.10<\/td>\n<td>\/var\/www\/site-a<\/td>\n<\/tr>\n<tr>\n<td>site-b.example<\/td>\n<td>198.51.100.20<\/td>\n<td>\/var\/www\/site-b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7ad9\u70b9A\u914d\u7f6e&#xff1a;<\/p>\n<p>server {<br \/>\n    listen 192.0.2.10:80;<br \/>\n    server_name site-a.example www.site-a.example;<\/p>\n<p>    root \/var\/www\/site-a;<br \/>\n    index index.html index.htm;<\/p>\n<p>    access_log \/var\/log\/nginx\/site-a.access.log;<br \/>\n    error_log  \/var\/log\/nginx\/site-a.error.log warn;<\/p>\n<p>    location \/ {<br \/>\n        try_files $uri $uri\/ &#061;404;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u7ad9\u70b9B\u914d\u7f6e&#xff1a;<\/p>\n<p>server {<br \/>\n    listen 198.51.100.20:80;<br \/>\n    server_name site-b.example www.site-b.example;<\/p>\n<p>    root \/var\/www\/site-b;<br \/>\n    index index.html index.htm;<\/p>\n<p>    access_log \/var\/log\/nginx\/site-b.access.log;<br \/>\n    error_log  \/var\/log\/nginx\/site-b.error.log warn;<\/p>\n<p>    location \/ {<br \/>\n        try_files $uri $uri\/ &#061;404;<br \/>\n    }<br \/>\n}<\/p>\n<p>Debian\u6216Ubuntu\u901a\u5e38\u628a\u6587\u4ef6\u653e\u5728 \/etc\/nginx\/sites-available\/&#xff0c;\u518d\u94fe\u63a5\u5230 \/etc\/nginx\/sites-enabled\/&#xff1b;\u5176\u4ed6\u53d1\u884c\u7248\u4e5f\u53ef\u80fd\u4f7f\u7528 \/etc\/nginx\/conf.d\/\u3002\u5b9e\u9645\u4f4d\u7f6e\u53ef\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u67e5\u770b&#xff1a;<\/p>\n<p>nginx <span class=\"token parameter variable\">-T<\/span><\/p>\n<p>nginx -T \u4f1a\u8f93\u51fa\u5b8c\u6574\u914d\u7f6e&#xff0c;\u516c\u5f00\u7c98\u8d34\u524d\u5e94\u5220\u9664\u57df\u540d\u3001\u5185\u90e8\u8def\u5f84\u3001\u8bc1\u4e66\u4f4d\u7f6e\u548c\u771f\u5b9eIP\u7b49\u654f\u611f\u4fe1\u606f\u3002<\/p>\n<h3>\u56db\u3001HTTPS\u5982\u4f55\u7ed1\u5b9a\u4e0d\u540cIP<\/h3>\n<p>\u6bcf\u4e2a\u7ad9\u70b9\u5206\u522b\u6307\u5b9a\u76d1\u542cIP\u3001\u8bc1\u4e66\u548c\u79c1\u94a5&#xff1a;<\/p>\n<p>server {<br \/>\n    listen 192.0.2.10:443 ssl;<br \/>\n    server_name site-a.example;<\/p>\n<p>    ssl_certificate     \/etc\/letsencrypt\/live\/site-a.example\/fullchain.pem;<br \/>\n    ssl_certificate_key \/etc\/letsencrypt\/live\/site-a.example\/privkey.pem;<\/p>\n<p>    root \/var\/www\/site-a;<br \/>\n}<\/p>\n<p>\u53e6\u4e00\u4e2a\u7ad9\u70b9\u4f7f\u7528 198.51.100.20:443 \u548c\u81ea\u5df1\u7684\u8bc1\u4e66\u3002\u4e0d\u8981\u628a\u4e0d\u540c\u7ad9\u70b9\u7684\u79c1\u94a5\u6df7\u7528&#xff0c;\u4e5f\u4e0d\u8981\u628a\u79c1\u94a5\u5185\u5bb9\u4e0a\u4f20\u5230\u5de5\u5355\u3001\u4ee3\u7801\u4ed3\u5e93\u6216\u516c\u5f00\u6587\u7ae0\u3002<\/p>\n<p>HTTP\/2\u7684\u914d\u7f6e\u8bed\u6cd5\u4e0eNginx\u7248\u672c\u6709\u5173\u3002\u4fee\u6539\u524d\u5148\u6267\u884c nginx -v&#xff0c;\u5e76\u4ee5\u5f53\u524d\u7248\u672c\u7684\u5b98\u65b9\u6587\u6863\u4e3a\u51c6\u3002<\/p>\n<h3>\u4e94\u3001\u91cd\u8f7d\u524d\u540e\u600e\u6837\u9a8c\u8bc1<\/h3>\n<p>\u6bcf\u6b21\u4fee\u6539\u90fd\u5e94\u5148\u68c0\u67e5\u8bed\u6cd5&#xff1a;<\/p>\n<p>nginx <span class=\"token parameter variable\">-t<\/span><\/p>\n<p>\u786e\u8ba4\u901a\u8fc7\u540e\u518d\u5e73\u6ed1\u91cd\u8f7d&#xff1a;<\/p>\n<p>systemctl reload nginx<\/p>\n<p>\u68c0\u67e5\u76d1\u542c\u72b6\u6001&#xff1a;<\/p>\n<p>ss <span class=\"token parameter variable\">-lntp<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> nginx<\/p>\n<p>\u5728DNS\u5c1a\u672a\u751f\u6548\u65f6&#xff0c;\u53ef\u4ee5\u7528 curl &#8211;resolve \u6307\u5b9a\u57df\u540d\u4e0eIP&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-I<\/span> <span class=\"token parameter variable\">&#8211;resolve<\/span> site-a.example:80:192.0.2.10 http:\/\/site-a.example\/<br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-I<\/span> <span class=\"token parameter variable\">&#8211;resolve<\/span> site-b.example:80:198.51.100.20 http:\/\/site-b.example\/<\/p>\n<p>HTTPS\u6d4b\u8bd5\u65f6\u628a\u7aef\u53e3\u6539\u4e3a443\u5e76\u4f7f\u7528 https:\/\/\u3002\u4e0d\u5efa\u8bae\u7528 -k \u957f\u671f\u5ffd\u7565\u8bc1\u4e66\u9519\u8bef&#xff1b;\u8bc1\u4e66\u6821\u9a8c\u5931\u8d25\u65f6\u5e94\u68c0\u67e5\u57df\u540d\u3001\u8bc1\u4e66\u94fe\u548c\u6709\u6548\u671f\u3002<\/p>\n<h3>\u516d\u3001\u56db\u7c7b\u5e38\u89c1\u6545\u969c<\/h3>\n<h4>1. \u8bf7\u6c42\u603b\u662f\u8fdb\u5165\u9519\u8bef\u7ad9\u70b9<\/h4>\n<p>\u68c0\u67e5\u662f\u5426\u4ecd\u6709\u5176\u4ed6\u914d\u7f6e\u4f7f\u7528 listen 80 default_server; \u6216 listen 0.0.0.0:80;\u3002\u540c\u4e00 \u5730\u5740:\u7aef\u53e3 \u4e0a&#xff0c;\u5982\u679c\u57df\u540d\u6ca1\u6709\u5339\u914d\u6210\u529f&#xff0c;\u8bf7\u6c42\u4f1a\u8fdb\u5165\u8be5\u5730\u5740\u7684\u9ed8\u8ba4\u865a\u62df\u4e3b\u673a\u3002<\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u6700\u7ec8\u914d\u7f6e\u4e2d\u6240\u6709\u76d1\u542c\u9879&#xff1a;<\/p>\n<p>nginx <span class=\"token parameter variable\">-T<\/span> <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span>\/dev\/null <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-nE<\/span> <span class=\"token string\">&#039;listen|server_name&#039;<\/span><\/p>\n<h4>2. \u7aef\u53e3\u5df2\u7ecf\u88ab\u5360\u7528<\/h4>\n<p>ss <span class=\"token parameter variable\">-lntp<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-E<\/span> <span class=\"token string\">&#039;:80|:443&#039;<\/span><\/p>\n<p>\u5982\u679cApache\u3001\u53e6\u4e00\u5957Nginx\u6216\u9762\u677f\u670d\u52a1\u5df2\u5360\u7528\u76f8\u540c\u5730\u5740\u548c\u7aef\u53e3&#xff0c;\u9700\u8981\u5148\u660e\u786e\u7531\u54ea\u4e2a\u670d\u52a1\u8d1f\u8d23\u76d1\u542c&#xff0c;\u4e0d\u80fd\u76f4\u63a5\u7ed3\u675f\u672a\u77e5\u8fdb\u7a0b\u3002<\/p>\n<h4>3. \u672c\u673a\u6b63\u5e38&#xff0c;\u5916\u7f51\u65e0\u6cd5\u8bbf\u95ee<\/h4>\n<p>\u4f9d\u6b21\u68c0\u67e5&#xff1a;<\/p>\n<ul>\n<li>\u4e91\u5e73\u53f0\u6216\u673a\u623f\u9632\u706b\u5899\u662f\u5426\u653e\u884c80\u548c443&#xff1b;<\/li>\n<li>\u7cfb\u7edf\u9632\u706b\u5899\u89c4\u5219&#xff1b;<\/li>\n<li>IP\u3001\u63a9\u7801\u3001\u7f51\u5173\u548c\u7b56\u7565\u8def\u7531&#xff1b;<\/li>\n<li>\u57df\u540dA\u8bb0\u5f55\u662f\u5426\u6307\u5411\u6b63\u786eIP&#xff1b;<\/li>\n<li>\u4e0a\u6e38\u662f\u5426\u5b58\u5728\u7aef\u53e3\u9650\u5236\u3002<\/li>\n<\/ul>\n<h4>4. \u591aIP\u914d\u7f6e\u540e\u56de\u5305\u8d70\u9519\u51fa\u53e3<\/h4>\n<p>\u670d\u52a1\u5668\u62e5\u6709\u591a\u4e2a\u7f51\u6bb5\u65f6&#xff0c;\u5165\u7ad9\u5730\u5740\u548c\u56de\u7a0b\u8def\u7531\u53ef\u80fd\u4e0d\u4e00\u81f4\u3002\u5148\u7528 ip route get \u76ee\u6807\u5730\u5740 from \u672c\u5730IP \u68c0\u67e5\u8def\u7531\u9009\u62e9&#xff1b;\u590d\u6742\u573a\u666f\u53ef\u80fd\u9700\u8981\u7b56\u7565\u8def\u7531\u3002\u4e0d\u8981\u5728\u4e0d\u6e05\u695a\u73b0\u6709\u7f51\u7edc\u7ed3\u6784\u65f6\u6279\u91cf\u4fee\u6539\u8def\u7531\u8868&#xff0c;\u4ee5\u514d\u5bfc\u81f4\u8fdc\u7a0b\u8fde\u63a5\u4e2d\u65ad\u3002<\/p>\n<h3>\u4e03\u3001\u6279\u91cf\u7ba1\u7406\u65f6\u7684\u5b9e\u8df5\u5efa\u8bae<\/h3>\n<li>\u4e3a\u6bcf\u4e2a\u7ad9\u70b9\u5355\u72ec\u4fdd\u5b58\u914d\u7f6e\u6587\u4ef6\u3001\u65e5\u5fd7\u548c\u8bc1\u4e66\u8def\u5f84&#xff1b;<\/li>\n<li>\u5efa\u7acb\u201c\u57df\u540d\u2014\u76d1\u542cIP\u2014\u7ad9\u70b9\u76ee\u5f55\u2014\u8bc1\u4e66\u2014\u8d1f\u8d23\u4eba\u201d\u7684\u8d44\u4ea7\u8868&#xff1b;<\/li>\n<li>\u4f7f\u7528\u6a21\u677f\u6216\u914d\u7f6e\u7ba1\u7406\u5de5\u5177\u751f\u6210\u6587\u4ef6&#xff0c;\u4f46\u6bcf\u6b21\u90e8\u7f72\u4ecd\u6267\u884c nginx -t&#xff1b;<\/li>\n<li>\u4e0d\u8981\u628a\u5b8c\u6574IP\u6e05\u5355\u3001SSH\u8d26\u53f7\u3001\u9762\u677f\u53e3\u4ee4\u548c\u8bc1\u4e66\u79c1\u94a5\u5199\u5165\u516c\u5f00\u4ed3\u5e93&#xff1b;<\/li>\n<li>\u591a\u4e2aIP\u89e3\u51b3\u7684\u662f\u76d1\u542c\u3001\u9694\u79bb\u548c\u7ba1\u7406\u95ee\u9898&#xff0c;\u4e0d\u80fd\u4f5c\u4e3a\u641c\u7d22\u6392\u540d\u627f\u8bfa\u3002<\/li>\n<p>\u5982\u679c\u9700\u8981\u5148\u7edf\u8ba1\u4e00\u6279IPv4\u6d89\u53ca\u591a\u5c11\u4e2a \/24\u3001\u662f\u5426\u8fde\u7eed&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u6d4f\u89c8\u5668\u672c\u5730\u8fd0\u884c\u7684IP\u7f51\u6bb5\u68c0\u6d4b\u5de5\u5177&#xff1a;<\/p>\n<p>https:\/\/www.shijihulian.com\/ip-distribution-check.html<\/p>\n<h3>\u53c2\u8003\u8d44\u6599<\/h3>\n<ul>\n<li>Nginx listen \u6307\u4ee4&#xff1a;https:\/\/nginx.org\/en\/docs\/http\/ngx_http_core_module.html#listen<\/li>\n<li>Nginx Server Names&#xff1a;https:\/\/nginx.org\/en\/docs\/http\/server_names.html<\/li>\n<li>Nginx\u8bf7\u6c42\u5904\u7406\u6d41\u7a0b&#xff1a;https:\/\/nginx.org\/en\/docs\/http\/request_processing.html<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u53f0Linux\u670d\u52a1\u5668\u914d\u7f6e\u591a\u4e2aIPv4\u540e&#xff0c;\u5e38\u89c1\u9700\u6c42\u662f\u8ba9\u4e0d\u540c\u7f51\u7ad9\u5206\u522b\u76d1\u542c\u4e0d\u540cIP&#xff0c;\u800c\u4e0d\u662f\u8ba9\u6240\u6709\u7ad9\u70b9\u5171\u540c\u76d1\u542c 0.0.0.0:80\u3002Nginx\u53ef\u4ee5\u901a\u8fc7 listen IP:\u7aef\u53e3 \u5b9e\u73b0IP\u7ea7\u76d1\u542c&#xff0c;\u518d\u4f7f\u7528 server_name \u5339\u914d\u57df\u540d\u3002<br \/>\n\u672c\u6587\u4f7f\u7528\u6587\u6863\u793a\u4f8b\u5730\u5740 192.0.2.10 \u548c 198.51.100.20\u3002\u5b83\u4eec\u4e0d\u80fd\u7528\u4e8e\u751f\u4ea7\u7f51\u7edc&#xff0c;\u8bf7\u66ff\u6362\u6210\u670d\u52a1\u5668\u5b9e\u9645\u5206\u914d\u7684IP\u3002<br \/>\n\u4e00\u3001\u5148\u7406\u89e3 listen \u548c server_name \u7684\u5206<\/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,205,78],"topic":[],"class_list":["post-99396","post","type-post","status-publish","format-standard","hentry","category-server","tag-nginx","tag-tcp-ip","tag-78"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Nginx\u5982\u4f55\u8ba9\u591a\u4e2a\u7f51\u7ad9\u7ed1\u5b9a\u4e0d\u540cIP\uff1alisten\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u5e38\u89c1\u6545\u969c - \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\/99396.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Nginx\u5982\u4f55\u8ba9\u591a\u4e2a\u7f51\u7ad9\u7ed1\u5b9a\u4e0d\u540cIP\uff1alisten\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u5e38\u89c1\u6545\u969c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u53f0Linux\u670d\u52a1\u5668\u914d\u7f6e\u591a\u4e2aIPv4\u540e&#xff0c;\u5e38\u89c1\u9700\u6c42\u662f\u8ba9\u4e0d\u540c\u7f51\u7ad9\u5206\u522b\u76d1\u542c\u4e0d\u540cIP&#xff0c;\u800c\u4e0d\u662f\u8ba9\u6240\u6709\u7ad9\u70b9\u5171\u540c\u76d1\u542c 0.0.0.0:80\u3002Nginx\u53ef\u4ee5\u901a\u8fc7 listen IP:\u7aef\u53e3 \u5b9e\u73b0IP\u7ea7\u76d1\u542c&#xff0c;\u518d\u4f7f\u7528 server_name \u5339\u914d\u57df\u540d\u3002 \u672c\u6587\u4f7f\u7528\u6587\u6863\u793a\u4f8b\u5730\u5740 192.0.2.10 \u548c 198.51.100.20\u3002\u5b83\u4eec\u4e0d\u80fd\u7528\u4e8e\u751f\u4ea7\u7f51\u7edc&#xff0c;\u8bf7\u66ff\u6362\u6210\u670d\u52a1\u5668\u5b9e\u9645\u5206\u914d\u7684IP\u3002 \u4e00\u3001\u5148\u7406\u89e3 listen \u548c server_name \u7684\u5206\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/99396.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-02T07:04:30+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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99396.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/99396.html\",\"name\":\"Nginx\u5982\u4f55\u8ba9\u591a\u4e2a\u7f51\u7ad9\u7ed1\u5b9a\u4e0d\u540cIP\uff1alisten\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u5e38\u89c1\u6545\u969c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-02T07:04:30+00:00\",\"dateModified\":\"2026-09-02T07:04:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/99396.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/99396.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99396.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Nginx\u5982\u4f55\u8ba9\u591a\u4e2a\u7f51\u7ad9\u7ed1\u5b9a\u4e0d\u540cIP\uff1alisten\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u5e38\u89c1\u6545\u969c\"}]},{\"@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":"Nginx\u5982\u4f55\u8ba9\u591a\u4e2a\u7f51\u7ad9\u7ed1\u5b9a\u4e0d\u540cIP\uff1alisten\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u5e38\u89c1\u6545\u969c - \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\/99396.html","og_locale":"zh_CN","og_type":"article","og_title":"Nginx\u5982\u4f55\u8ba9\u591a\u4e2a\u7f51\u7ad9\u7ed1\u5b9a\u4e0d\u540cIP\uff1alisten\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u5e38\u89c1\u6545\u969c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u53f0Linux\u670d\u52a1\u5668\u914d\u7f6e\u591a\u4e2aIPv4\u540e&#xff0c;\u5e38\u89c1\u9700\u6c42\u662f\u8ba9\u4e0d\u540c\u7f51\u7ad9\u5206\u522b\u76d1\u542c\u4e0d\u540cIP&#xff0c;\u800c\u4e0d\u662f\u8ba9\u6240\u6709\u7ad9\u70b9\u5171\u540c\u76d1\u542c 0.0.0.0:80\u3002Nginx\u53ef\u4ee5\u901a\u8fc7 listen IP:\u7aef\u53e3 \u5b9e\u73b0IP\u7ea7\u76d1\u542c&#xff0c;\u518d\u4f7f\u7528 server_name \u5339\u914d\u57df\u540d\u3002 \u672c\u6587\u4f7f\u7528\u6587\u6863\u793a\u4f8b\u5730\u5740 192.0.2.10 \u548c 198.51.100.20\u3002\u5b83\u4eec\u4e0d\u80fd\u7528\u4e8e\u751f\u4ea7\u7f51\u7edc&#xff0c;\u8bf7\u66ff\u6362\u6210\u670d\u52a1\u5668\u5b9e\u9645\u5206\u914d\u7684IP\u3002 \u4e00\u3001\u5148\u7406\u89e3 listen \u548c server_name \u7684\u5206","og_url":"https:\/\/www.wsisp.com\/helps\/99396.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-02T07:04:30+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/99396.html","url":"https:\/\/www.wsisp.com\/helps\/99396.html","name":"Nginx\u5982\u4f55\u8ba9\u591a\u4e2a\u7f51\u7ad9\u7ed1\u5b9a\u4e0d\u540cIP\uff1alisten\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u5e38\u89c1\u6545\u969c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-02T07:04:30+00:00","dateModified":"2026-09-02T07:04:30+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/99396.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/99396.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/99396.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Nginx\u5982\u4f55\u8ba9\u591a\u4e2a\u7f51\u7ad9\u7ed1\u5b9a\u4e0d\u540cIP\uff1alisten\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u5e38\u89c1\u6545\u969c"}]},{"@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\/99396","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=99396"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99396\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=99396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=99396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=99396"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=99396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}