{"id":4518,"date":"2014-11-19T16:50:40","date_gmt":"2014-11-19T14:50:40","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=4518"},"modified":"2016-01-08T19:29:09","modified_gmt":"2016-01-08T17:29:09","slug":"nginx-%d0%b8-%d1%81%d1%81%d1%8b%d0%bb%d0%ba%d0%b8-%d0%bd%d0%b0-location%d1%8b","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=4518","title":{"rendered":"[nginx] \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 location&#8217;\u044b"},"content":{"rendered":"<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u0437 <strong>wiki<\/strong> (<strong>nginx.org<\/strong>):<\/p>\n<blockquote><p><span style=\"color: #993366;\">\u041f\u0440\u0435\u0444\u0438\u043a\u0441 &#8220;@&#8221; \u0437\u0430\u0434\u0430\u0451\u0442 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 location. \u0422\u0430\u043a\u043e\u0439 location \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0430 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043d\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0422\u0430\u043a\u0438\u0435 location\u2019\u044b \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 location\u2019\u044b.<\/span><\/p><\/blockquote>\n<p>\u041a \u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u044f? \u0410 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 <strong>location<\/strong>, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f, \u043d\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043d\u0443\u0436\u043d\u044b\u0445 <strong>location&#8217;\u043e\u0432<\/strong>. \u041f\u043e\u043a\u0430\u0436\u0443 \u044d\u0442\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<p><!--more--><\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430: \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c <strong>location \/doc<\/strong> \u0438 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043d\u0435\u0433\u043e \u0438 \u0435\u0433\u043e \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <strong>index.php<\/strong>. \u0417\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0435\u0449\u0451 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a <strong>php<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 &#8220;\u043b\u043e\u043c\u0430\u0435\u0442&#8221; (\u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0432 \u043b\u043e\u043a\u0435\u0439\u0448\u0438\u043d\u0435 <strong>\/doc<\/strong>, \u0432 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0434\u043b\u044f <strong>php<\/strong>) \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u0438\u0434\u0430<strong> \/doc\/dfsdf.php<\/strong><\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c:<\/p>\n<pre>...\r\n        location \/doc {\r\n                try_files $uri @doc;\r\n        }\r\n\r\n        location ~ ^\/doc\/(.*\\.php) {\r\n                try_files $uri @doc;\r\n        }\r\n                \r\n        location @doc {\r\n                try_files $uri \/index.php;\r\n                index index.php;\r\n                include fastcgi_params;\r\n                fastcgi_index index.php;\r\n                fastcgi_pass fastcgi_backend;\r\n                fastcgi_send_timeout 180;\r\n                fastcgi_read_timeout 180;\r\n                fastcgi_buffer_size 128k; \r\n                fastcgi_buffers 4 128k;\r\n                fastcgi_busy_buffers_size 128k;\r\n                fastcgi_temp_file_write_size 128k; \r\n                fastcgi_param   DOCUMENT_ROOT   \/opt\/sites\/www_api;\r\n                fastcgi_param   SCRIPT_FILENAME \/opt\/sites\/www_api\/index.php;\r\n                fastcgi_param   PATH_TRANSLATED \/opt\/sites\/www_api\/index.php;\r\n                fastcgi_param   REMOTE_USER     $remote_user;\r\n                fastcgi_param   REMOTE_ADDR     $remote_addr;\r\n                fastcgi_param   GEOIP_COUNTRY_CODE    $geoip_city_country_code;\r\n                fastcgi_param   GEOIP_COUNTRY_NAME    $geoip_city_country_name;\r\n                fastcgi_param   GEOIP_REGION    $geoip_region;\r\n                fastcgi_param   GEOIP_CITY      $geoip_city;  \r\n        }       \r\n         \r\n                \r\n        location ~* ^.+\\.(php)$ {\r\n                try_files  $uri  \/404.html;\r\n                include fastcgi_params;\r\n                fastcgi_pass fastcgi_backend;\r\n                fastcgi_send_timeout 180;\r\n                fastcgi_read_timeout 180;\r\n                fastcgi_buffer_size 128k;\r\n                fastcgi_buffers 4 128k;\r\n                fastcgi_busy_buffers_size 128k;\r\n                fastcgi_temp_file_write_size 128k;\r\n                fastcgi_param   DOCUMENT_ROOT   \/opt\/sites\/www_api;\r\n                fastcgi_param   SCRIPT_FILENAME \/opt\/sites\/www_api$fastcgi_script_name;\r\n                fastcgi_param   PATH_TRANSLATED \/opt\/sites\/www_api$fastcgi_script_name;\r\n                fastcgi_param   REMOTE_USER     $remote_user;\r\n                fastcgi_param   REMOTE_ADDR     $remote_addr;\r\n                fastcgi_param   GEOIP_COUNTRY_CODE    $geoip_city_country_code;\r\n                fastcgi_param   GEOIP_COUNTRY_NAME    $geoip_city_country_name;\r\n                fastcgi_param   GEOIP_REGION    $geoip_region;\r\n                fastcgi_param   GEOIP_CITY      $geoip_city;        \r\n...\r\n<\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f <strong>location&#8217;a<\/strong>, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e &#8211; &#8216;<strong>@<\/strong>&#8216; \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u043b \u043d\u0430\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u0437 wiki (nginx.org): \u041f\u0440\u0435\u0444\u0438\u043a\u0441 &#8220;@&#8221; \u0437\u0430\u0434\u0430\u0451\u0442 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 location. \u0422\u0430\u043a\u043e\u0439 location \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0430 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043d\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0422\u0430\u043a\u0438\u0435 location\u2019\u044b \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 location\u2019\u044b. \u041a \u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u044f? \u0410 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 location, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-4518","post","type-post","status-publish","format-standard","hentry","category-www"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4518","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=4518"}],"version-history":[{"count":3,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4518\/revisions"}],"predecessor-version":[{"id":5598,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4518\/revisions\/5598"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}