{"id":3706,"date":"2013-08-26T15:07:00","date_gmt":"2013-08-26T12:07:00","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=3706"},"modified":"2013-11-13T10:31:57","modified_gmt":"2013-11-13T08:31:57","slug":"nginx-%d0%b8%d1%81%d0%ba%d0%bb%d1%8e%d1%87%d0%b5%d0%bd%d0%b8%d1%8f-%d0%b4%d0%bb%d1%8f-auth_basic","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=3706","title":{"rendered":"[nginx] \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f auth_basic"},"content":{"rendered":"<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u044b\u0445 <strong>IP auth_basic<\/strong>, \u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441. \u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e <strong>IP<\/strong>, \u0430 \u043d\u0435 \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 nginx&#8217;e \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c <strong>satisfy<\/strong>. \u041d\u0438\u0436\u0435 \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/p>\n<p><em><span style=\"color: #ff6600;\">\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/span><\/em>: satisfy all | any;<br \/>\n<em><span style=\"color: #ff6600;\">\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u0435<\/span><\/em>: satisfy all;<br \/>\n<em><span style=\"color: #ff6600;\">\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/span><\/em>: http, server, location<\/p>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f, \u0435\u0441\u043b\u0438 \u043e\u0431\u0430 (<strong>all<\/strong>) \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d (<strong>any<\/strong>) \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 <strong>ngx_http_access_module<\/strong> \u0438 <strong>ngx_http_auth_basic_module<\/strong> \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f.<br \/>\n<!--more--><\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<p><code>server{<br \/>\nlisten *:80;<br \/>\nlisten *:443 default ssl;<br \/>\nserver_name domain.com<br \/>\naccess_log off;<br \/>\nssl on;<br \/>\nssl_certificate \/etc\/nginx\/ssl2011.crt;<br \/>\nssl_certificate_key \/etc\/nginx\/ssl2011.key;<br \/>\nroot \/opt\/www;<br \/>\nsatisfy any;<br \/>\nallow 10.10.10.10;<br \/>\nallow 127.0.0.1;<br \/>\ndeny all;<br \/>\nauth_basic \"closed site\";<br \/>\nauth_basic_user_file \/usr\/local\/.htpasswd;<br \/>\n...<br \/>\n}<\/code><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u0439\u0442\u0438 \u0441 \u0445\u043e\u0441\u0442\u0430 <strong>10.10.10.10<\/strong> \u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0430\u0440\u043e\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438 \u043d\u0430\u0441 \u043f\u0443\u0441\u0442\u0438\u0442.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u044b\u0445 IP auth_basic, \u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441. \u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e IP, \u0430 \u043d\u0435 \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 nginx&#8217;e \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c satisfy. \u041d\u0438\u0436\u0435 \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441: satisfy all | any; \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u0435: satisfy all; \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442: http, server, location \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f, \u0435\u0441\u043b\u0438 \u043e\u0431\u0430 (all) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-3706","post","type-post","status-publish","format-standard","hentry","category-www"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/3706","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3706"}],"version-history":[{"count":2,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/3706\/revisions"}],"predecessor-version":[{"id":3942,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/3706\/revisions\/3942"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}