{"id":509,"date":"2009-04-23T13:16:40","date_gmt":"2009-04-23T12:16:40","guid":{"rendered":"http:\/\/thekua.com\/atwork\/?p=509"},"modified":"2022-03-14T13:33:26","modified_gmt":"2022-03-14T12:33:26","slug":"active-passive-load-balancer-configuration-for-nginx","status":"publish","type":"post","link":"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/","title":{"rendered":"Active Passive Load Balancer Configuration for Nginx"},"content":{"rendered":"<p>Here&#8217;s the configuration file that we ended up with testing an active passive configuration for our application using the software load balancer <a href=\"https:\/\/web.archive.org\/web\/20170309150904\/http:\/\/wiki.nginx.org\/\">Nginx<\/a> that I previously posted about. <\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">worker_processes  1;\r\nerror_log  logs\/error.log;\r\nevents {\r\n    worker_connections  1024;\r\n}\r\n\r\n####################################\r\n#\r\n#          loadbalancer\r\n#         localhost:7777\r\n#           \/          \\\r\n#   webServerA         webServerB\r\n# localhost:8080      localhost:8181\r\n#    (active)           (passive)\r\n#\r\n####################################\r\n\r\nhttp {\r\n    include               mime.types;\r\n    default_type          application\/octet-stream;\r\n    proxy_connect_timeout 2s;\r\n    proxy_read_timeout    2s;\r\n\r\n    sendfile              on;\r\n    keepalive_timeout     65;\r\n\r\n    upstream backend {\r\n        server 127.0.0.1:8080     fail_timeout=1s max_fails=1;    # active node\r\n        server 127.0.0.1:8181     backup;                         # passive node\r\n    }\r\n\r\n    server {\r\n        listen                   7777;\r\n        server_name  localhost;\r\n\r\n        location \/ {\r\n            proxy_pass http:\/\/backend;\r\n        }\r\n\r\n        error_page   500 502 503 504  \/50x.html;\r\n        location = \/50x.html {\r\n            root   html;\r\n        }\r\n    }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s the configuration file that we ended up with testing an active passive configuration for our application using the software load balancer Nginx that I previously posted about. worker_processes 1; error_log logs\/error.log; events { worker_connections 1024; } #################################### # # loadbalancer # localhost:7777 # \/ \\ # webServerA webServerB # localhost:8080 localhost:8181 # (active) (passive) [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-509","post","type-post","status-publish","format-standard","hentry","category-development","post-preview"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Active Passive Load Balancer Configuration for Nginx - patkua@work<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Active Passive Load Balancer Configuration for Nginx - patkua@work\" \/>\n<meta property=\"og:description\" content=\"Here&#8217;s the configuration file that we ended up with testing an active passive configuration for our application using the software load balancer Nginx that I previously posted about. worker_processes 1; error_log logs\/error.log; events { worker_connections 1024; } #################################### # # loadbalancer # localhost:7777 # \/  # webServerA webServerB # localhost:8080 localhost:8181 # (active) (passive) [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/\" \/>\n<meta property=\"og:site_name\" content=\"patkua@work\" \/>\n<meta property=\"article:published_time\" content=\"2009-04-23T12:16:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-14T12:33:26+00:00\" \/>\n<meta name=\"author\" content=\"Patrick\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@patkua\" \/>\n<meta name=\"twitter:site\" content=\"@patkua\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Patrick\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2009\\\/04\\\/active-passive-load-balancer-configuration-for-nginx\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2009\\\/04\\\/active-passive-load-balancer-configuration-for-nginx\\\/\"},\"author\":{\"name\":\"Patrick\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\"},\"headline\":\"Active Passive Load Balancer Configuration for Nginx\",\"datePublished\":\"2009-04-23T12:16:40+00:00\",\"dateModified\":\"2022-03-14T12:33:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2009\\\/04\\\/active-passive-load-balancer-configuration-for-nginx\\\/\"},\"wordCount\":111,\"commentCount\":0,\"articleSection\":[\"Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thekua.com\\\/atwork\\\/2009\\\/04\\\/active-passive-load-balancer-configuration-for-nginx\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2009\\\/04\\\/active-passive-load-balancer-configuration-for-nginx\\\/\",\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2009\\\/04\\\/active-passive-load-balancer-configuration-for-nginx\\\/\",\"name\":\"Active Passive Load Balancer Configuration for Nginx - patkua@work\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#website\"},\"datePublished\":\"2009-04-23T12:16:40+00:00\",\"dateModified\":\"2022-03-14T12:33:26+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2009\\\/04\\\/active-passive-load-balancer-configuration-for-nginx\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thekua.com\\\/atwork\\\/2009\\\/04\\\/active-passive-load-balancer-configuration-for-nginx\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2009\\\/04\\\/active-passive-load-balancer-configuration-for-nginx\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Active Passive Load Balancer Configuration for Nginx\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#website\",\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/\",\"name\":\"patkua@work\",\"description\":\"The intersection of technology and leadership\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\",\"name\":\"Patrick\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"caption\":\"Patrick\"},\"sameAs\":[\"http:\\\/\\\/thekua.com\\\/atwork\"],\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/author\\\/patrick\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Active Passive Load Balancer Configuration for Nginx - patkua@work","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/","og_locale":"en_US","og_type":"article","og_title":"Active Passive Load Balancer Configuration for Nginx - patkua@work","og_description":"Here&#8217;s the configuration file that we ended up with testing an active passive configuration for our application using the software load balancer Nginx that I previously posted about. worker_processes 1; error_log logs\/error.log; events { worker_connections 1024; } #################################### # # loadbalancer # localhost:7777 # \/  # webServerA webServerB # localhost:8080 localhost:8181 # (active) (passive) [&hellip;]","og_url":"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/","og_site_name":"patkua@work","article_published_time":"2009-04-23T12:16:40+00:00","article_modified_time":"2022-03-14T12:33:26+00:00","author":"Patrick","twitter_card":"summary_large_image","twitter_creator":"@patkua","twitter_site":"@patkua","twitter_misc":{"Written by":"Patrick","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/#article","isPartOf":{"@id":"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/"},"author":{"name":"Patrick","@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae"},"headline":"Active Passive Load Balancer Configuration for Nginx","datePublished":"2009-04-23T12:16:40+00:00","dateModified":"2022-03-14T12:33:26+00:00","mainEntityOfPage":{"@id":"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/"},"wordCount":111,"commentCount":0,"articleSection":["Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/","url":"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/","name":"Active Passive Load Balancer Configuration for Nginx - patkua@work","isPartOf":{"@id":"https:\/\/thekua.com\/atwork\/#website"},"datePublished":"2009-04-23T12:16:40+00:00","dateModified":"2022-03-14T12:33:26+00:00","author":{"@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae"},"breadcrumb":{"@id":"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/thekua.com\/atwork\/2009\/04\/active-passive-load-balancer-configuration-for-nginx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thekua.com\/atwork\/"},{"@type":"ListItem","position":2,"name":"Active Passive Load Balancer Configuration for Nginx"}]},{"@type":"WebSite","@id":"https:\/\/thekua.com\/atwork\/#website","url":"https:\/\/thekua.com\/atwork\/","name":"patkua@work","description":"The intersection of technology and leadership","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thekua.com\/atwork\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae","name":"Patrick","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","caption":"Patrick"},"sameAs":["http:\/\/thekua.com\/atwork"],"url":"https:\/\/thekua.com\/atwork\/author\/patrick\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/comments?post=509"}],"version-history":[{"count":5,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/509\/revisions"}],"predecessor-version":[{"id":3663,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/509\/revisions\/3663"}],"wp:attachment":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/media?parent=509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/categories?post=509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/tags?post=509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}