{"id":1110,"date":"2012-05-07T17:44:17","date_gmt":"2012-05-07T09:44:17","guid":{"rendered":"http:\/\/www.strongd.net\/?p=1110"},"modified":"2016-07-21T10:12:46","modified_gmt":"2016-07-21T02:12:46","slug":"resin-nginx","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=1110","title":{"rendered":"resin + nginx"},"content":{"rendered":"<p>download the upstream jvm route from\u00a0<a href=\"http:\/\/code.google.com\/p\/nginx-upstream-jvm-route\/\">http:\/\/code.google.com\/p\/nginx-upstream-jvm-route\/<\/a><\/p>\n<p>[root@web1 nginx-1.2.0]# tar -zxf nginx-upstream-jvm-route-0.1.tar.gz<\/p>\n<p>[root@web1 nginx-1.2.0]# patch -p0 .\/nginx_upstream_jvm_route\/jvm_route.patch<\/p>\n<p>[root@web1 nginx-1.2.0]# .\/configure &#8211;sbin-path=\/usr\/sbin\/ &#8211;conf-path=\/etc\/nginx\/nginx.conf &#8211;with-http_stub_status_module &#8211;with-http_ssl_module &#8211;add-module=.\/nginx_upstream_jvm_route<\/p>\n<p>&nbsp;<\/p>\n<p>edit \/etc\/nginx\/nginx.conf<\/p>\n<p>add<\/p>\n<p>upstream resin_proxy {<\/p>\n<p>server 127.0.0.1:85 srun_id=app-by1 max_fails=2 fail_timeout=10s weight=200; \/\/\u8d1f\u8f7d\u5747\u8861<br \/>\nserver web3:85 srun_id=app-by2 max_fails=2 fail_timeout=10s weight=200; \u00a0 \u00a0 \u00a0\/\/\u8d1f\u8f7d\u5747\u8861<br \/>\njvm_route $cookie_JSESSIONID|sessionid;<br \/>\n}<\/p>\n<p>server {<br \/>\nlisten 80;<br \/>\nserver_name default yourhosts;<br \/>\nlocation \/ {<br \/>\nproxy_pass http:\/\/resin_proxy;<br \/>\ninclude proxy.conf;<br \/>\nindex index.jsp index.html index.htm;<br \/>\n}<br \/>\n}<\/p>\n<p>create proxy.conf<\/p>\n<p>proxy_redirect off;<br \/>\nproxy_set_header Host $host;<br \/>\nproxy_set_header Host $host;<br \/>\nproxy_set_header X-Real-IP $remote_addr;<br \/>\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>\nclient_max_body_size 10m;<br \/>\nclient_body_buffer_size 128k;<br \/>\nproxy_connect_timeout 300;<br \/>\nproxy_send_timeout 300;<br \/>\nproxy_read_timeout 300;<br \/>\nproxy_buffer_size 4k;<br \/>\nproxy_buffers 4 32k;<br \/>\nproxy_busy_buffers_size 64k;<br \/>\nproxy_temp_file_write_size 64k;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>download the upstream jvm route from\u00a0http:\/\/code.google.com\/p\/nginx-upstream-jvm-route\/ [root@web1 nginx-1.2.0]# tar -zxf nginx-upstream-jvm-route-0.1.tar.gz [root@web1 nginx-1.2.0]# patch -p0 .\/nginx_upstream_jvm_route\/jvm_route.patch [root@web1 nginx-1.2.0]# .\/configure &#8211;sbin-path=\/usr\/sbin\/ &#8211;conf-path=\/etc\/nginx\/nginx.conf &#8211;with-http_stub_status_module &#8211;with-http_ssl_module &#8211;add-module=.\/nginx_upstream_jvm_route &nbsp; edit \/etc\/nginx\/nginx.conf add upstream resin_proxy { server 127.0.0.1:85 srun_id=app-by1 max_fails=2 fail_timeout=10s weight=200; \/\/\u8d1f\u8f7d\u5747\u8861 server web3:85 srun_id=app-by2 max_fails=2 fail_timeout=10s weight=200; \u00a0 \u00a0 \u00a0\/\/\u8d1f\u8f7d\u5747\u8861 jvm_route $cookie_JSESSIONID|sessionid; } server { listen 80; server_name &hellip; <a href=\"https:\/\/www.strongd.net\/?p=1110\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">resin + nginx<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,3,20],"tags":[13,17],"class_list":["post-1110","post","type-post","status-publish","format-standard","hentry","category-nginx-2","category-resin","category-20","tag-nginx","tag-resin-2"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1110"}],"version-history":[{"count":4,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1110\/revisions"}],"predecessor-version":[{"id":1114,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/1110\/revisions\/1114"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}