{"id":2767,"date":"2012-07-08T14:22:29","date_gmt":"2012-07-08T11:22:29","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=2767"},"modified":"2012-07-13T16:14:33","modified_gmt":"2012-07-13T13:14:33","slug":"nginxfrontendapachebackend","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=2767","title":{"rendered":"nginx(frontend)+apache(backend)"},"content":{"rendered":"<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u043a\u0443 <strong>Apache+Nginx<\/strong> \u0434\u043b\u044f \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0422\u0430\u043a \u0436\u0435, \u0445\u043e\u0447\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 <strong>virtual hosts<\/strong>, \u0430 \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0441\u0442\u044f\u0449\u0438\u0439\u0441\u044f \u0441\u0430\u0439\u0442 (\u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442)<\/p>\n<p><!--more--><\/p>\n<p><strong><span style=\"color: #ff0000;\">1) \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Apache<\/span><\/strong><\/p>\n<p>\u0410\u043f\u0430\u0447 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u043f\u043e\u0440\u0442 <strong>88<\/strong>. \u0424\u0430\u0439\u043b\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f <strong>virtual<\/strong> \u0445\u043e\u0441\u0442\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0443 \u043d\u0430\u0441 \u0432 <strong>vhosts<\/strong> \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0430\u043f\u043a\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c apache \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430 <strong>&#8216;.conf&#8217;<\/strong>. \u0412 \u0444\u0430\u0439\u043b <strong>httpd.conf<\/strong> \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0435 (\u0438\u043b\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0432\u0438\u0434\u0443, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c)<\/p>\n<p><code>Listen 127.0.0.1:88<br \/>\nInclude etc\/apache22\/vhosts\/*.conf<br \/>\nNameVirtualHost *:88<\/code><\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0444\u0430\u0439\u043b sait.com \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>vhosts<\/strong> \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<p><code>&lt;VirtualHost *:88&gt;<br \/>\nServerName sait.com<br \/>\nServerAlias *.sait.com<br \/>\nDocumentRoot \/www\/sait.com<br \/>\nErrorLog \"\/var\/log\/apache\/sait.com-error\"<br \/>\nCustomLog \"\/var\/log\/apache\/sait.com-access\" common<br \/>\n&lt;\/VirtualHost&gt;<\/code><\/p>\n<p>\u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e <strong>virtual<\/strong> \u0445\u043e\u0441\u0442\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 <strong>sait.com<\/strong><\/p>\n<p><strong><span style=\"color: #ff0000;\">2) \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 nginx<\/span><\/strong><\/p>\n<p><strong>nginx<\/strong> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044f <strong>HTTP_REALIP<\/strong>, \u0438\u043d\u0430\u0447\u0435 \u0432 <strong>apache<\/strong> \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u0434\u0440\u0435\u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u0435\u0442\u0438\u0442\u044c\u0441\u044f <strong>127.0.0.1<\/strong>)<\/p>\n<p>\u0412 <strong>nginx.conf<\/strong>, \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0435 <strong>http<\/strong> \u043f\u0438\u0448\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n<p><code>include vhosts\/*.conf;<\/code><\/p>\n<p>\u0424\u0430\u0439\u043b\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f <strong>virtual<\/strong> \u0445\u043e\u0441\u0442\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0443 \u043d\u0430\u0441 \u0432<strong> vhosts<\/strong> \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0430\u043f\u043a\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c <strong>nginx<\/strong> \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430 &#8216;<strong>.conf<\/strong>&#8216;. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 <strong>sait.com<\/strong>:<\/p>\n<p><code> location \/ {<br \/>\ntry_files $uri @drupal;<br \/>\n}<br \/>\nlocation ~ \\.php$ {<br \/>\nproxy_pass http:\/\/127.0.0.1:88;<br \/>\nproxy_redirect default;<br \/>\nproxy_set_header Host $host;<br \/>\nproxy_set_header X-Real-IP $remote_addr;<br \/>\nclient_max_body_size 10m;<br \/>\nclient_body_buffer_size 128k;<br \/>\nproxy_send_timeout 180s;<br \/>\nproxy_read_timeout 180s;<br \/>\nproxy_buffer_size 32k;<br \/>\nproxy_buffers 16 32k;<br \/>\nproxy_busy_buffers_size 64k;<br \/>\nproxy_temp_file_write_size 64k;<br \/>\n}<br \/>\nlocation @drupal {<br \/>\nproxy_pass http:\/\/127.0.0.1:88;<br \/>\nproxy_redirect default;<br \/>\nproxy_set_header Host $host;<br \/>\nproxy_set_header X-Real-IP $remote_addr;<br \/>\nclient_max_body_size 10m;<br \/>\nclient_body_buffer_size 128k;<br \/>\nproxy_send_timeout 180s;<br \/>\nproxy_read_timeout 180s;<br \/>\nproxy_buffer_size 32k;<br \/>\nproxy_buffers 16 32k;<br \/>\nproxy_busy_buffers_size 64k;<br \/>\nproxy_temp_file_write_size 64k;<br \/>\n}<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u043a\u0443 Apache+Nginx \u0434\u043b\u044f \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0422\u0430\u043a \u0436\u0435, \u0445\u043e\u0447\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 virtual hosts, \u0430 \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0441\u0442\u044f\u0449\u0438\u0439\u0441\u044f \u0441\u0430\u0439\u0442 (\u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442)<\/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-2767","post","type-post","status-publish","format-standard","hentry","category-www"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2767","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=2767"}],"version-history":[{"count":5,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2767\/revisions"}],"predecessor-version":[{"id":2769,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2767\/revisions\/2769"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}