{"id":126,"date":"2024-10-18T21:07:54","date_gmt":"2024-10-18T14:07:54","guid":{"rendered":"https:\/\/megadump.ru\/?p=126"},"modified":"2024-12-22T15:39:50","modified_gmt":"2024-12-22T08:39:50","slug":"nginx-block-ip","status":"publish","type":"post","link":"https:\/\/phpha.ru\/?p=126","title":{"rendered":"\u041a\u0430\u043a \u0432 nginx \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0441 IP"},"content":{"rendered":"\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e URL \u0441\u0430\u0439\u0442\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 IP \u0430\u0434\u0440\u0435\u0441\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u043e\u0432\u044b <code>allow <\/code>\u0438 <code>deny <\/code>\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0441\u0430\u0439\u0442\u0430 nginx. \u041c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0446\u0435\u043b\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438, \u0442\u0430\u043a \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043b\u044e\u0431\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u043c\u0443 IP \u0430\u0434\u0440\u0435\u0441\u0443 \u0438 \u0446\u0435\u043b\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438, \u0433\u0434\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-nginx\">location \/admin {\n    allow 192.168.1.10;\n    allow 192.168.2.0\/24;\n    deny all;\n}<\/code><\/pre>\n\n\n\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/nginx.org\/en\/docs\/http\/ngx_http_access_module.html\" target=\"_blank\" rel=\"noreferrer noopener\">ngx_http_access_module<\/a>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e URL \u0441\u0430\u0439\u0442\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 IP \u0430\u0434\u0440\u0435\u0441\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u043e\u0432\u044b allow \u0438 deny \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0441\u0430\u0439\u0442\u0430 nginx. \u041c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0446\u0435\u043b\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438, \u0442\u0430\u043a \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043b\u044e\u0431\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[29,15],"class_list":["post-126","post","type-post","status-publish","format-standard","hentry","category-web","tag-access","tag-nginx"],"_links":{"self":[{"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/posts\/126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpha.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=126"}],"version-history":[{"count":3,"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":129,"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/posts\/126\/revisions\/129"}],"wp:attachment":[{"href":"https:\/\/phpha.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpha.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpha.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}