{"id":1434,"date":"2015-01-04T23:20:21","date_gmt":"2015-01-04T14:20:21","guid":{"rendered":"http:\/\/tech.akat.info\/?p=1434"},"modified":"2015-01-05T00:14:42","modified_gmt":"2015-01-04T15:14:42","slug":"nginx-%e5%9f%ba%e7%a4%8e%e7%9f%a5%e8%ad%98","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=1434","title":{"rendered":"nginx-\u57fa\u790e\u77e5\u8b58-"},"content":{"rendered":"<h1>nginx\u3068\u306f<\/h1>\n<p>\u9ad8\u3044\u4e26\u884c\u6027\u3068\u51e6\u7406\u80fd\u529b\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306e\u5c0f\u3055\u3055\u306b\u91cd\u70b9\u3092\u304a\u3044\u305f\u8a2d\u8a08\u3068\u306a\u3063\u3066\u3044\u308b<br \/>\n\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(apache\u306eprefork\uff1a\u30d7\u30ed\u30bb\u30b9\u99c6\u52d5\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3)\u3092\u63a1\u7528\u3057\u3066\u304a\u308a<br \/>\n\u51e6\u7406\u304c\u8efd\u304f\u3001\u5927\u91cf\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u3055\u3070\u304f\u3053\u3068\u304c\u5f97\u610f\u3001C10K\u554f\u984c\u3092\u89e3\u6d88\u3055\u308c\u308b<br \/>\n\u9006\u306bcpu\u51e6\u7406\u304c\u5fc5\u8981\u306a\u51e6\u7406\u306b\u306f\u5411\u3044\u3066\u3044\u306a\u3044<br \/>\n\u51e6\u7406\u6642\u9593\u304c\u9577\u304f\u306a\u308b\u51e6\u7406\u3092\u5b9f\u884c\u3057\u305f\u969b\u306b\u305d\u3053\u3067\u30d7\u30ed\u30bb\u30b9\u304c\u30d6\u30ed\u30c3\u30af\u3055\u308c\u3066\u3057\u307e\u3044\u51e6\u7406\u80fd\u529b\u304c\u843d\u3061\u308b<\/p>\n<h1>\u57fa\u672c\u30b3\u30de\u30f3\u30c9<\/h1>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n### \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u78ba\u8a8d ###\r\nroot@hostname:\/home\/shimizu# \/etc\/init.d\/nginx configtest\r\nTesting nginx configuration: nginx.\r\nroot@hostname:\/home\/shimizu# nginx -t\r\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\r\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful\r\n### \u30d0\u30fc\u30b8\u30e7\u30f3\u3084\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306e\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b ###\r\nroot@hostname:\/home\/shimizu# nginx -V\r\nnginx version: nginx\/1.2.1\r\nTLS SNI support enabled\r\nconfigure arguments: --prefix=\/etc\/nginx --conf-path=\/etc\/nginx\/nginx.conf --error-log-path=\/var\/log\/nginx\/error.log --http-cent-body-temp-path=\/var\/lib\/nginx\/body --http-fastcgi-temp-path=\/var\/lib\/nginx\/fastcgi --http-log-path=\/var\/log\/nginx\/access.g --http-proxy-temp-path=\/var\/lib\/nginx\/proxy --http-scgi-temp-path=\/var\/lib\/nginx\/scgi --http-uwsgi-temp-path=\/var\/lib\/nginxwsgi --lock-path=\/var\/lock\/nginx.lock --pid-path=\/var\/run\/nginx.pid --with-pcre-jit --with-debug --with-http_addition_module with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_dule --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_realip_module --with-http_sece_link_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv--with-sha1=\/usr\/include\/openssl --with-md5=\/usr\/include\/openssl --with-mail --with-mail_ssl_module --add-module=\/tmp\/buildd\/inx-1.2.1\/debian\/modules\/nginx-auth-pam --add-module=\/tmp\/buildd\/nginx-1.2.1\/debian\/modules\/chunkin-nginx-module --add-moduletmp\/buildd\/nginx-1.2.1\/debian\/modules\/headers-more-nginx-module --add-module=\/tmp\/buildd\/nginx-1.2.1\/debian\/modules\/nginx-devopment-kit --add-module=\/tmp\/buildd\/nginx-1.2.1\/debian\/modules\/nginx-echo --add-module=\/tmp\/buildd\/nginx-1.2.1\/debian\/modulesginx-http-push --add-module=\/tmp\/buildd\/nginx-1.2.1\/debian\/modules\/nginx-lua --add-module=\/tmp\/buildd\/nginx-1.2.1\/debian\/modus\/nginx-upload-module --add-module=\/tmp\/buildd\/nginx-1.2.1\/debian\/modules\/nginx-upload-progress --add-module=\/tmp\/buildd\/ngin1.2.1\/debian\/modules\/nginx-upstream-fair --add-module=\/tmp\/buildd\/nginx-1.2.1\/debian\/modules\/nginx-dav-ext-module\r\n<\/pre>\n<h1>\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3068\u3057\u3066\u5229\u7528\u3059\u308b<\/h1>\n<h2>header\u306b\u3064\u3044\u3066<\/h2>\n<p>proxy_set_header\u3067HTTP Host header\u3092forward\u3059\u308b<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nproxy_set_header host $host;\r\n<\/pre>\n<p>### X-Forwarded-Host:\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u30db\u30b9\u30c8\u540d\u3002\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c Host \u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u3067\u6e21\u3059<br \/>\n\u672c\u5f53\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u3001\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308b\u3088\u3046\u306b\u3059\u308b\u3079\u304d<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nproxy_set_header X-Forwarded-Host $host;\r\n<\/pre>\n<h2>max_fails\u306b\u3064\u3044\u3066<\/h2>\n<p>\u3053\u3053\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u56de\u6570\u306e\u901a\u4fe1\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3068(\u6b21\u306efail_timeout\u5f15\u6570\u3067\u6307\u5b9a\u305f\u308c\u305f\u6642\u9593\u5185\u306b)<br \/>\nNginx\u306f\u30b5\u30fc\u30d0\u304c\u52d5\u4f5c\u3057\u3066\u3044\u306a\u3044\u3068\u5224\u65ad\u3059\u308b\u3002\u30c7\u30d5\u30a9\u30eb\u30c81\u56de\u30020\u3060\u3068\u3053\u306e\u30c1\u30a7\u30c3\u30af\u3092\u7121\u8996\u3059\u308b\u3002<br \/>\n(\u3053\u3053\u3067\u3044\u3046\u901a\u4fe1\u30a8\u30e9\u30fc\u306f proxy_next_upstream\u3068fastcgi_next_upstream\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u3082\u306e\u3002\u305f\u3060\u3057\u3001404\u30a8\u30e9\u30fc\u306f\u542b\u307e\u306a\u3044)<\/p>\n<h2>fail_timeout\u306b\u3064\u3044\u3066<\/h2>\n<p>\u3053\u306e\u9593\u306bmax_fails\u3060\u3051\u901a\u4fe1\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3068\u3001\u3001\u30b5\u30fc\u30d0\u304c\u52d5\u4f5c\u3057\u3066\u3044\u306a\u3044\u3068\u307f\u306a\u3055\u308c\u308b<br \/>\n\u307f\u306a\u3055\u308c\u305f\u3089\u3001\u3053\u306e\u6642\u9593\u304c\u7d42\u308f\u308b\u307e\u3067\u30b5\u30fc\u30d0\u306f\u30c0\u30a6\u30f3\u3057\u3066\u3044\u308b\u3068\u307f\u306a\u3055\u308c\u308b\u3002\u30c7\u30d5\u30a9\u30eb\u30c810s<br \/>\n\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3059\u308b\u305f\u3081\u306b\u306f\u3001proxy_connect_timeout\u3068proxy_read_timeout\u3092\u5229\u7528\u3059\u3079\u3057<\/p>\n<p>\u30fbproxy_connect_timeout(default:60s)<br \/>\n\u3000upstream\u30b5\u30fc\u30d0\u3068\u306e\u63a5\u7d9a\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3092\u5b9a\u7fa9\u300275\u79d2\u4ee5\u4e0a\u306f\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044<br \/>\n\u3000\u30b5\u30fc\u30d0\u304c\u30da\u30fc\u30b8\u3092\u8fd4\u3059\u307e\u3067\u306e\u6642\u9593\u3067\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3002(\u305d\u308c\u306f proxy_read_timeout\u306e\u4ed5\u4e8b)<br \/>\n\u3000\u3082\u3057\u30b5\u30fc\u30d0\u304c\u5fa9\u65e7\u3057\u3066\u3001\u305f\u3060\u30b9\u30ec\u30c3\u30c9\u304c\u3042\u304c\u308a\u304d\u3063\u3066\u306a\u304f\u3066\u30cf\u30f3\u30b0\u30a2\u30c3\u30d7\u3057\u305f\u3068\u304d\u306a\u3069\u306f\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306f\u5f79\u306b\u7acb\u305f\u306a\u3044<\/p>\n<p>\u30fbproxy_read_timeout(default:60s)<br \/>\n\u3000\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306f\u30d7\u30ed\u30ad\u30b7\u30b5\u30fc\u30d0\u304c\u8aad\u3080\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593\u3092\u8a2d\u5b9a\u3059\u308b\u3002nginx\u304c\u30ec\u30b9\u30dd\u30f3\u30b9\u3059\u308b\u307e\u3067\u306b\u3069\u308c\u304f\u3089\u3044\u306e\u6642\u9593\u3092\u5f85\u3064\u304b\u5b9a\u7fa9<\/p>\n<p>\u30fbproxy_next_upstream<br \/>\n\u3000Default:error timeout<br \/>\n\u3000\u901a\u4fe1\u30a8\u30e9\u30fc\u3082\u3057\u304f\u306f\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3067\u6b21\u306e\u30b5\u30fc\u30d0\u306b<\/p>\n<h1>\u53c2\u8003URL<\/h1>\n<p>nginx\u3067\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u5148\u306b\u30db\u30b9\u30c8\u540d\u304c\u5f15\u304d\u7d99\u304c\u308c\u306a\u3044<br \/>\nhttp:\/\/blog.fujimuradaisuke.com\/post\/12622482560\/nginx<br \/>\n\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0<br \/>\nhttp:\/\/httpd.apache.org\/docs\/2.2\/mod\/mod_proxy.html#x-headers<br \/>\nupstream\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6<br \/>\nhttp:\/\/wiki.nginx.org\/NginxHttpUpstreamModule#upstream<\/p>\n","protected":false},"excerpt":{"rendered":"<p>nginx\u3068\u306f \u9ad8\u3044\u4e26\u884c\u6027\u3068\u51e6\u7406\u80fd\u529b\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306e\u5c0f\u3055\u3055\u306b\u91cd\u70b9\u3092\u304a\u3044\u305f\u8a2d\u8a08\u3068\u306a\u3063\u3066\u3044\u308b \u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(apache\u306eprefork\uff1a\u30d7\u30ed\u30bb\u30b9\u99c6\u52d5\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3)\u3092\u63a1\u7528\u3057\u3066\u304a\u308a \u51e6\u7406\u304c\u8efd\u304f\u3001\u5927\u91cf\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[18],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1434"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1434"}],"version-history":[{"count":2,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1434\/revisions"}],"predecessor-version":[{"id":1436,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1434\/revisions\/1436"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}