{"id":10129,"date":"2025-12-23T05:12:36","date_gmt":"2025-12-23T05:12:36","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=10129"},"modified":"2025-12-23T05:47:13","modified_gmt":"2025-12-23T05:47:13","slug":"configure-multiple-host-names-nginx","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/","title":{"rendered":"How to Configure Multiple Host Names in NGINX"},"content":{"rendered":"\n<p>NGINX is a popular web server used by millions of high traffic websites as well as blogs. It is very versatile since it can be used as a reverse proxy or a load balancer. Often system administrators need to run multiple websites on NGINX server. For this run each website on a different physical\/virtual server, which can be expensive and difficult to manage. Did you know that you can run multiple websites on a single NGINX server instance? In this article, we will learn how to configure multiple host names in NGINX.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#Why_Configure_Multiple_Host_Names_in_a_Server\" >Why Configure Multiple Host Names in a Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#How_to_Configure_Multiple_Host_Names_in_NGINX\" >How to Configure Multiple Host Names in NGINX<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#1_Configure_Multiple_Websites_in_NGINX\" >1. Configure Multiple Websites in NGINX<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#Create_Document_Root_Directories\" >Create Document Root Directories<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#Create_Test_Pages\" >Create Test Pages<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#Create_Virtual_Host_Files\" >Create Virtual Host Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#Enable_Virtual_Hosts\" >Enable Virtual Hosts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#Reload_NGINX\" >Reload NGINX<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#Test_Websites\" >Test Websites<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#2_Configure_Multiple_Domains_to_Same_Website\" >2. Configure Multiple Domains to Same Website<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Configure_Multiple_Host_Names_in_a_Server\"><\/span>Why Configure Multiple Host Names in a Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are significant benefits of setting up multiple hosts in NGINX.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Cost Effective<\/strong> &#8211; NGINX allows you to serve multiple domains, subdomains and websites from a single domain, instead of using separate servers for each of them. This can save a lot of server costs<\/li>\n\n\n\n<li><strong>Easy to Manage<\/strong> &#8211;  It is easier to manage multiple domains and subdomains from a single server instead of using separate virtual servers or hosting accounts.<\/li>\n\n\n\n<li><strong>Resource Sharing<\/strong> &#8211; If you run several low-medium traffic sites and blogs, then it makes sense to run them all on a single server instance, where they can share the memory, CPU and disk space more efficiently. NGINX will make sure that they do not interfere with each other&#8217;s resources.<\/li>\n\n\n\n<li><strong>Simpler Routing<\/strong> &#8211; Based on the value of <em>requested<\/em> request header, NGINX will appropriately route the request to proper domain or subdomain.<\/li>\n\n\n\n<li><strong>Scalable<\/strong> &#8211; As you need to host new domains or subdomains, you can easily add them to your existing server by simply modifying NGINX configuration. No need to buy more infrastructure. It is a centralized yet scalable set up.<\/li>\n\n\n\n<li><strong>Better Organized<\/strong> &#8211; Even if all your web content is located on a single server, you can  configure different host names (e.g. blog, API, app, etc.) to serve content from each of these locations. This keeps your work neatly organized.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Configure_Multiple_Host_Names_in_NGINX\"><\/span>How to Configure Multiple Host Names in NGINX<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are a couple of different ways to set up multiple host names in NGINX. In the first approach, we will learn how to host completely different websites located on same physical infrastructure, using a single server. In this case, each host serves different requests and content.<\/p>\n\n\n\n<p>In the second case, we simply configure multiple domains and subdomains to point to the same website folder. In this case, all these sites serve same request paths and content.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Configure_Multiple_Websites_in_NGINX\"><\/span>1. Configure Multiple Websites in NGINX<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this examples, we we will setup NGINX to serve to completely different websites site1.com and site2.com.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_Document_Root_Directories\"><\/span>Create Document Root Directories<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>First, we will create separate document root directories for each website. Make sure your NGINX user has permission to access the contents of these folders.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo mkdir -p \/var\/www\/site1.com\/html<br>sudo mkdir -p \/var\/www\/site2.com\/html<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_Test_Pages\"><\/span>Create Test Pages<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>We will create a couple of simple test pages that we will request while testing these sites. For this, we will create index.html page in each document root, along with some simple text to be displayed on page load.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo 'hello site1' | sudo tee \/var\/www\/site1.com\/index.html<br>echo 'hello site2' | sudo tee \/var\/www\/site2.com\/index.html<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_Virtual_Host_Files\"><\/span>Create Virtual Host Files<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Next, we will create separate <a href=\"https:\/\/en.wikipedia.org\/wiki\/Virtual_hosting\">virtual host<\/a> configuration files for each website. Here&#8217;s an example to create virtual host file for site1.com.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo vi \/etc\/nginx\/sites-available\/site1.com.conf<\/pre>\n\n\n\n<p>Add the following server block in this virtual host file. Customize it as per your requirement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {<br>    listen 80;<br>    server_name site1.com;<br>    root \/var\/www\/site1.com\/html;<br>    index index.html;<br>    <br>    location \/ {<br>      try_files $uri $uri\/ =404;<br>    } <br>    ...<br>}<\/pre>\n\n\n\n<p>The above code tells NGINX that this virtual host file listens to port 80 and serves requests sent to site1.com domain. Its document root is also specified.<\/p>\n\n\n\n<p>Save and close the file. Repeat this step for site2.com. Create virtual host config file for site2.com.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo vi \/etc\/nginx\/sites-available\/site1.com.conf<\/pre>\n\n\n\n<p>Add the following code to this file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {<br>    listen 80;<br>    server_name site2.com;<br>    root \/var\/www\/site2.com\/html;<br>    index index.html;<br>    <br>    location \/ {<br>      try_files $uri $uri\/ =404;<br>    } <br>    ...<br>}<\/pre>\n\n\n\n<p>The above code tells NGINX that this virtual host file listens to port 80 and serves requests sent to site2.com domain. Save and close this file too.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Enable_Virtual_Hosts\"><\/span>Enable Virtual Hosts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Enable the above 2 virtual hosts by creating symbolic links to them in \/etc\/nginx\/sites-enabled folder.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ln -s \/etc\/nginx\/sites-available\/site1.com.conf \/etc\/nginx\/sites-enabled\/site1.com.conf<br><br>sudo ln -s \/etc\/nginx\/sites-available\/site2.com.conf \/etc\/nginx\/sites-enabled\/site2.com.conf<\/pre>\n\n\n\n<p>Now the actual files reside in \/etc\/nginx\/sites-available and symbolic links exist in \/etc\/nginx\/sites-enabled directory. You may need to remove default_server file from \/etc\/nginx\/sites-enabled directory, to avoid any routing conflicts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Reload_NGINX\"><\/span>Reload NGINX<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Reload NGINX to apply changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl reload nginx<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Test_Websites\"><\/span>Test Websites<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Now you have two virtual hosts listening to port 80. When you request a page from site1.com, NGINX will route the request to virtual host with site1.com in its server_name directive. That is site1.com.conf. This virtual host will process the request and send back the response. Similar routing happens in case of request to site2.com.<\/p>\n\n\n\n<p>Open web browser and go to http:\/\/site1.com\/index.html and http:\/\/site2.com\/index.html. You should be able to see the contents of their respective index.html pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Configure_Multiple_Domains_to_Same_Website\"><\/span>2. Configure Multiple Domains to Same Website<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Sometimes, you may want to point one or more domains\/sub domains to a single website. In other words, you may want to serve the same content for example1.com\/product as well as example2.com\/product. In such cases, you can directly use server_name directive to point different domains to same website folder. You do not need to set up separate virtual hosts for this purpose.<\/p>\n\n\n\n<p>Open NGINX configuration file and add the following line to the server blocks listening to ports 80 and 443.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server_name example1.com example2.com;<\/pre>\n\n\n\n<p>Here is an example.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n   listen 80;\n   ...\n   server_name example1.com example2.com;\n   ...\n}<\/pre>\n\n\n\n<p>Now, whether you request example1.com or example2.com, you will see the same content on your web browser. You can also use this method to point different sub domains to same website.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {<br>   listen 80;<br>   ...<br>   server_name blog.example.com articles.example.com;<br>   ...<br>}<\/pre>\n\n\n\n<p>Save and close the file. Restart NGINX to apply changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt how to configure multiple domains on a single NGINX server. We have learnt about the benefits of doing so. We have also learnt how to set up multiple host names on NGINX server, in case they serve different content, that is, each domain points to a different website altogether. We have also learnt how to configure NGINX to serve same content for different domain names. You can use the above steps as per your requirement.<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/increase-file-upload-size-nginx\/\">How to Increase File Upload Size in NGINX<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/block-image-hotlinking-allow-google\/\">How to Block Image Hotlinking But Allow Google<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/\">How to Remove Trailing Slash in NGINX<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes system administrators need to configure multiple host names in NGINX server. Here are the steps to do this.<\/p>\n","protected":false},"author":1,"featured_media":10147,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[619],"class_list":["post-10129","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nginx","tag-multiple-hosts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Configure Multiple Host Names in NGINX - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Sometimes system administrators need to configure multiple host names in NGINX server. Here are the steps to do this.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Configure Multiple Host Names in NGINX - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Sometimes system administrators need to configure multiple host names in NGINX server. Here are the steps to do this.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2025-12-23T05:12:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-23T05:47:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/configure-multiple-host-names-nginx.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"288\" \/>\n\t<meta property=\"og:image:height\" content=\"192\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Configure Multiple Host Names in NGINX\",\"datePublished\":\"2025-12-23T05:12:36+00:00\",\"dateModified\":\"2025-12-23T05:47:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/\"},\"wordCount\":1036,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/configure-multiple-host-names-nginx.jpg?fit=288%2C192&ssl=1\",\"keywords\":[\"multiple hosts\"],\"articleSection\":[\"Nginx\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/\",\"name\":\"How to Configure Multiple Host Names in NGINX - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/configure-multiple-host-names-nginx.jpg?fit=288%2C192&ssl=1\",\"datePublished\":\"2025-12-23T05:12:36+00:00\",\"dateModified\":\"2025-12-23T05:47:13+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Sometimes system administrators need to configure multiple host names in NGINX server. Here are the steps to do this.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/configure-multiple-host-names-nginx.jpg?fit=288%2C192&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/configure-multiple-host-names-nginx.jpg?fit=288%2C192&ssl=1\",\"width\":288,\"height\":192,\"caption\":\"configure multiple host names in nginx\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/configure-multiple-host-names-nginx\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Configure Multiple Host Names in NGINX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Configure Multiple Host Names in NGINX - Ubiq BI","description":"Sometimes system administrators need to configure multiple host names in NGINX server. Here are the steps to do this.","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:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/","og_locale":"en_US","og_type":"article","og_title":"How to Configure Multiple Host Names in NGINX - Ubiq BI","og_description":"Sometimes system administrators need to configure multiple host names in NGINX server. Here are the steps to do this.","og_url":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2025-12-23T05:12:36+00:00","article_modified_time":"2025-12-23T05:47:13+00:00","og_image":[{"width":288,"height":192,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/configure-multiple-host-names-nginx.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Configure Multiple Host Names in NGINX","datePublished":"2025-12-23T05:12:36+00:00","dateModified":"2025-12-23T05:47:13+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/"},"wordCount":1036,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/configure-multiple-host-names-nginx.jpg?fit=288%2C192&ssl=1","keywords":["multiple hosts"],"articleSection":["Nginx"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/","url":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/","name":"How to Configure Multiple Host Names in NGINX - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/configure-multiple-host-names-nginx.jpg?fit=288%2C192&ssl=1","datePublished":"2025-12-23T05:12:36+00:00","dateModified":"2025-12-23T05:47:13+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Sometimes system administrators need to configure multiple host names in NGINX server. Here are the steps to do this.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/configure-multiple-host-names-nginx.jpg?fit=288%2C192&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/configure-multiple-host-names-nginx.jpg?fit=288%2C192&ssl=1","width":288,"height":192,"caption":"configure multiple host names in nginx"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Configure Multiple Host Names in NGINX"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/configure-multiple-host-names-nginx.jpg?fit=288%2C192&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2Dn","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=10129"}],"version-history":[{"count":27,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10129\/revisions"}],"predecessor-version":[{"id":10158,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10129\/revisions\/10158"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/10147"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=10129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=10129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=10129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}