{"id":8493,"date":"2022-09-02T11:46:37","date_gmt":"2022-09-02T11:46:37","guid":{"rendered":"https:\/\/clustercs.com\/kb\/?docs=docly-documentation\/speed-optimizations\/actions\/speed-engine-serve-with"},"modified":"2022-09-19T13:06:40","modified_gmt":"2022-09-19T13:06:40","slug":"speed-engine-serve-with","status":"publish","type":"docs","link":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/","title":{"rendered":"Speed Engine \u2013 Serve With"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Deliver your website content with the best web service for the task. In the article \u201c<a href=\"https:\/\/clustercs.com\/kb\/?docs=docly-documentation\/speed-optimizations\/concepts\/getting-started-with-speed-engine\"><strong>ClusterCS Speed Engine \u2013 Concepts<\/strong><\/a>\u201d we\u2019ve explained our concept of routing request types to specific web services. A quick example is whether you want to serve PHP with\u00a0<a href=\"https:\/\/httpd.apache.org\/\">Apache<\/a>\u00a0or\u00a0<a href=\"https:\/\/www.nginx.com\/\">NGINX<\/a>. Or maybe decide to improve server utilization and delivery speed by using a lightweight server such as Lighttpd or NGINX for serving static files (images, Javascripts, CSS).<\/p>\n\n\n\n<p>\u201cServe With\u201d action allows you to configure the web requests to be handled with a specific server if the associated conditions are met.<\/p>\n\n\n\n<p><strong>Since examples are easy to understand in this case, let\u2019s go over a few scenarios.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1662372923736\"><strong>1.&nbsp; Serve static files with Lighttpd<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Static-files-to-lighttpd-1024x341.jpg\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Static-files-to-lighttpd-1024x341.jpg\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>This rule states that if the path component of the URL ends with common static file extensions, the rule should be handled by Lighttpd. It is a default rule added by ClusterCS when adding a new domain to instantly improve the server resource usage from your web site requests. In some occasions, your website script may not provide the resource at the exact URL location (for eg on the fly generated thumbnails in Drupal) which can lead to Lighttpd returning a 404 Not Found error. In such cases, you may disable or remove this rule so that traffic flows to your default backend service or to another rule that you create to better handle the situation. In certain occasion, these resources are generated on the fly by the script and you can often find great improvements if you replace the static files rule with a \u201c<strong><a href=\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-cache-with\/\">Cache With<\/a><\/strong>\u201d rule to intercept this traffic. This alleviates the problem of the script continuously generating resources on every request. For more information on \u201c<a href=\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-cache-with\/\" title=\"\"><strong>Cache With<\/strong><\/a>\u201d action please read the following article \u201c<a href=\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-cache-with\/\"><strong>cache with<\/strong><\/a>\u201d<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1662372923710\"><strong>2. Serve with NGINX<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Serve-with-NGINX-1024x341.jpg\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Serve-with-NGINX-1024x341.jpg\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>It\u2019s easy to send traffic to NGINX. Compared to Apache, NGINX lacks the capability to read .htaccess files which is a general standard for rewrite rules in most of the common scripts. Instead of relying on htaccess, rewrites must be placed in the NGINX server block. You can easily find resources to customize your NGINX setup and ClusterCS makes it possible to add those by customizing the corresponding block configuration.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Serve-with-NGINX_editing-1024x646.jpg\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Serve-with-NGINX_editing-1024x646.jpg\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>Click Customize next to Serve With NGINX and you can enter your custom rules<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Customize-next-to-Serve-With-NGINX-1024x835.jpg\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Customize-next-to-Serve-With-NGINX-1024x835.jpg\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>The custom NGINX config in its basic form contains a series of variables marked with a starting and ending $ sign which is later replaced by corresponding values based on various rules. We advise against replacing or removing those as in most cases it will result in broken configurations. These elements should not interfere with any NGINX customizations you need to&nbsp; and, in most cases, you need to add your rules at the end of the server block (before the last \u2018}\u2019 sign)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1662372923683\">3.&nbsp;<strong>Serve with Apache<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Serve-with-Apache-1024x393.jpg\"><img decoding=\"async\" src=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Serve-with-Apache-1024x393.jpg\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>Apache is set as the default server in standard&nbsp;<strong>ClusterCS<\/strong>&nbsp;setups. If you need to change the default or force Apache in certain conditions in between other rules you define, this easy selector achieves this.&nbsp;The Speed Engine allows multiple \u201cServe With\u201d rules and it\u00b4s very important to remember the order of the rules matter. Use the drag icon to arrange them in the correct order. With NGINX you can have different custom configs per each zone which makes it easy to configure various custom rules per location, Example cases can include a web site which contains several types of scripts under the same domain (eg. Drupal, WordPress, etc.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Deliver your website content with the best web service for the task. In the article \u201cClusterCS Speed Engine \u2013 Concepts\u201d we\u2019ve explained our concept of routing request types to specific web services. A quick example is whether you want to serve PHP with\u00a0Apache\u00a0or\u00a0NGINX. Or maybe decide to improve server utilization and delivery speed by using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":8489,"menu_order":4,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-8493","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Speed Engine \u2013 Serve With - ClusterCS Knowledge Base<\/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:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Speed Engine \u2013 Serve With - ClusterCS Knowledge Base\" \/>\n<meta property=\"og:description\" content=\"Deliver your website content with the best web service for the task. In the article \u201cClusterCS Speed Engine \u2013 Concepts\u201d we\u2019ve explained our concept of routing request types to specific web services. A quick example is whether you want to serve PHP with\u00a0Apache\u00a0or\u00a0NGINX. Or maybe decide to improve server utilization and delivery speed by using [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/\" \/>\n<meta property=\"og:site_name\" content=\"ClusterCS Knowledge Base\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-19T13:06:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Static-files-to-lighttpd-1024x341.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/\",\"url\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/\",\"name\":\"Speed Engine \u2013 Serve With - ClusterCS Knowledge Base\",\"isPartOf\":{\"@id\":\"https:\/\/clustercs.com\/kb\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Static-files-to-lighttpd-1024x341.jpg\",\"datePublished\":\"2022-09-02T11:46:37+00:00\",\"dateModified\":\"2022-09-19T13:06:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/#primaryimage\",\"url\":\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Static-files-to-lighttpd-1024x341.jpg\",\"contentUrl\":\"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Static-files-to-lighttpd-1024x341.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/clustercs.com\/kb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ClusterCS Documentation\",\"item\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Speed Optimizations\",\"item\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Actions\",\"item\":\"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Speed Engine \u2013 Serve With\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/clustercs.com\/kb\/#website\",\"url\":\"https:\/\/clustercs.com\/kb\/\",\"name\":\"ClusterCS Knowledge Base\",\"description\":\"Welcome to ClusterCS Documentation\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/clustercs.com\/kb\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Speed Engine \u2013 Serve With - ClusterCS Knowledge Base","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:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/","og_locale":"en_US","og_type":"article","og_title":"Speed Engine \u2013 Serve With - ClusterCS Knowledge Base","og_description":"Deliver your website content with the best web service for the task. In the article \u201cClusterCS Speed Engine \u2013 Concepts\u201d we\u2019ve explained our concept of routing request types to specific web services. A quick example is whether you want to serve PHP with\u00a0Apache\u00a0or\u00a0NGINX. Or maybe decide to improve server utilization and delivery speed by using [&hellip;]","og_url":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/","og_site_name":"ClusterCS Knowledge Base","article_modified_time":"2022-09-19T13:06:40+00:00","og_image":[{"url":"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Static-files-to-lighttpd-1024x341.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/","url":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/","name":"Speed Engine \u2013 Serve With - ClusterCS Knowledge Base","isPartOf":{"@id":"https:\/\/clustercs.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/#primaryimage"},"image":{"@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/#primaryimage"},"thumbnailUrl":"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Static-files-to-lighttpd-1024x341.jpg","datePublished":"2022-09-02T11:46:37+00:00","dateModified":"2022-09-19T13:06:40+00:00","breadcrumb":{"@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/#primaryimage","url":"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Static-files-to-lighttpd-1024x341.jpg","contentUrl":"https:\/\/clustercs.com\/oldkb\/wp-content\/uploads\/2018\/11\/Static-files-to-lighttpd-1024x341.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/speed-engine-serve-with\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/clustercs.com\/kb\/"},{"@type":"ListItem","position":2,"name":"ClusterCS Documentation","item":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/"},{"@type":"ListItem","position":3,"name":"Speed Optimizations","item":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/"},{"@type":"ListItem","position":4,"name":"Actions","item":"https:\/\/clustercs.com\/kb\/docs\/clustercs\/speed-optimizations\/actions\/"},{"@type":"ListItem","position":5,"name":"Speed Engine \u2013 Serve With"}]},{"@type":"WebSite","@id":"https:\/\/clustercs.com\/kb\/#website","url":"https:\/\/clustercs.com\/kb\/","name":"ClusterCS Knowledge Base","description":"Welcome to ClusterCS Documentation","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/clustercs.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/docs\/8493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/comments?post=8493"}],"version-history":[{"count":3,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/docs\/8493\/revisions"}],"predecessor-version":[{"id":8990,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/docs\/8493\/revisions\/8990"}],"up":[{"embeddable":true,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/docs\/8489"}],"wp:attachment":[{"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/media?parent=8493"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/clustercs.com\/kb\/wp-json\/wp\/v2\/doc_tag?post=8493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}