{"id":10180,"date":"2025-12-30T05:16:53","date_gmt":"2025-12-30T05:16:53","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=10180"},"modified":"2026-01-20T05:15:30","modified_gmt":"2026-01-20T05:15:30","slug":"how-to-redirect-location-to-another-domain-in-nginx","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/","title":{"rendered":"How to Redirect Location to Another Domain in NGINX"},"content":{"rendered":"\n<p>NGINX is a popular web server used by many high traffic websites and online stores. Often web developers and system administrators need to move a site or a URL to an entirely new domain. In such cases, they need to redirect location to another domain in NGINX. In this article, we will learn how to do this.<\/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\/how-to-redirect-location-to-another-domain-in-nginx\/#How_to_Redirect_Location_to_Another_Domain_in_NGINX\" >How to Redirect Location to Another Domain in NGINX<\/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\/how-to-redirect-location-to-another-domain-in-nginx\/#Permanent_Redirection\" >Permanent Redirection<\/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\/how-to-redirect-location-to-another-domain-in-nginx\/#Temporary_Redirection\" >Temporary Redirection<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Redirect_Location_to_Another_Domain_in_NGINX\"><\/span>How to Redirect Location to Another Domain in NGINX<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are two ways to redirect location in NGINX &#8211; permanent and temporary. Permanent redirection tells web browsers and search engines that the location has permanently moved so its new location can be cached for later use. In this case, NGINX will return response code 301. Temporary redirection means the location has only temporarily been moved and might come back. So web browsers and search engines must not save the redirection. In this case, NGINX will return response code 302.<\/p>\n\n\n\n<p>For both cases, you need to use <em>return<\/em> directive to return the appropriate response code as well as redirect user to new location. The return directive will immediately stop processing request and send redirect command back to client web browser. Based on the response received from server, the browser can immediately redirect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Permanent_Redirection\"><\/span>Permanent Redirection<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you have permanently moved the URL to a new location then it is best to set up permanent redirection (HTTP response 301). This will help search engines to note the change and pass on the SEO juice from old location to new location. Also, client web browsers will cache this change and directly take users to new location whenever the old location is requested on their browsers.<\/p>\n\n\n\n<p>Open NGINX configuration file in text editor.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo vi \/etc\/nginx\/nginx.conf<br>OR<br>sudo vi \/etc\/nginx\/sites-available\/nginx.conf<\/pre>\n\n\n\n<p>Let us say you want to redirect old-site.com\/old-url\/ to new domain new-site.com, then add the following location.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {<br>    listen 80;<br>    server_name old-site.com www.old-site.com;<br><br><strong>    location \/old-url\/ {<br>      return 301 new-site.com;<br>   }<\/strong><br>}<\/pre>\n\n\n\n<p>Save and close the file. In the above code, we use return statement to permanently redirect URL. When NGINX receives request for old URL, it will match this location and execute the return statement. This will return response code 301 to web browser, along with new URL location and then the browser will go to the new location. <\/p>\n\n\n\n<p>The above config will <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-rewrite-url-parameters-in-nginx\/\">redirect all URLs<\/a> starting with \/old-url\/ along with the request path and query parameters. For example, <em>old-site.com\/old-url\/product.html<\/em> will be redirected to <em>new-site.com\/old-url\/product.html<\/em><\/p>\n\n\n\n<p>If you want to redirect to new-site.com\/old-url\/ then update the return statement accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location \/old-url\/ {<br>    return 301 new-site.com\/old-url\/;<br>}<\/pre>\n\n\n\n<p>Lastly, restart NGINX server to apply changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl reload nginx<br>OR<br>sudo systemctl restart nginx<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Temporary_Redirection\"><\/span>Temporary Redirection<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>On the other hand, if you have temporarily moved the URL to new domain but do not want search engines to permanently store the redirection and transfer SEO juice of old URL to new domain, then use a temporary redirection. In this case, NGINX will return response code of 302 indicating temporary redirection.<\/p>\n\n\n\n<p>Open NGINX config file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo vi \/etc\/nginx\/nginx.conf<br>OR<br>sudo vi \/etc\/nginx\/sites-available\/nginx.conf<\/pre>\n\n\n\n<p>Add the following location block to it. It is similar to the previous code, except instead of 301 we are returning 302 response code.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {<br>    listen 80;<br>    server_name old-site.com www.old-site.com;<br><br><strong>    location \/old-url\/ {<br>      return 302 new-site.com;<br>   }<\/strong><br>}<\/pre>\n\n\n\n<p>Save and close the file. In the above code, the location block will match all requests starting with \/old-url\/ and redirect it to new location along with response code 302.<\/p>\n\n\n\n<p>Lastly, restart or reload NGINX server to apply changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl reload nginx<br>OR<br>sudo systemctl restart nginx<\/pre>\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 redirect location to another domain in NGINX server. We have learnt how to do this permanently as well as temporarily. You can use either of these solutions, depending on your requirement.<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/configure-multiple-host-names-nginx\/\">How to Configure Multiple Host Names in NGINX<\/a><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><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often system administrators need to redirect URLs &#038; web pages to another domain. Here is how to redirect location to another domain in NGINX.<\/p>\n","protected":false},"author":1,"featured_media":10194,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[620],"class_list":["post-10180","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nginx","tag-redirect-location"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Redirect Location to Another Domain in NGINX - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Often system administrators need to redirect URLs &amp; web pages to another domain. Here is how to redirect location to another domain in NGINX.\" \/>\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\/how-to-redirect-location-to-another-domain-in-nginx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Redirect Location to Another Domain in NGINX - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Often system administrators need to redirect URLs &amp; web pages to another domain. Here is how to redirect location to another domain in NGINX.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-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-30T05:16:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-20T05:15:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/redirect-url-to-new-domain-nginx.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"308\" \/>\n\t<meta property=\"og:image:height\" content=\"204\" \/>\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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Redirect Location to Another Domain in NGINX\",\"datePublished\":\"2025-12-30T05:16:53+00:00\",\"dateModified\":\"2026-01-20T05:15:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/\"},\"wordCount\":598,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/redirect-url-to-new-domain-nginx.jpg?fit=308%2C204&ssl=1\",\"keywords\":[\"redirect location\"],\"articleSection\":[\"Nginx\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/\",\"name\":\"How to Redirect Location to Another Domain in NGINX - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/redirect-url-to-new-domain-nginx.jpg?fit=308%2C204&ssl=1\",\"datePublished\":\"2025-12-30T05:16:53+00:00\",\"dateModified\":\"2026-01-20T05:15:30+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Often system administrators need to redirect URLs & web pages to another domain. Here is how to redirect location to another domain in NGINX.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/redirect-url-to-new-domain-nginx.jpg?fit=308%2C204&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/redirect-url-to-new-domain-nginx.jpg?fit=308%2C204&ssl=1\",\"width\":308,\"height\":204,\"caption\":\"redirect location to another domain in nginx\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-redirect-location-to-another-domain-in-nginx\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Redirect Location to Another Domain 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 Redirect Location to Another Domain in NGINX - Ubiq BI","description":"Often system administrators need to redirect URLs & web pages to another domain. Here is how to redirect location to another domain in NGINX.","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\/how-to-redirect-location-to-another-domain-in-nginx\/","og_locale":"en_US","og_type":"article","og_title":"How to Redirect Location to Another Domain in NGINX - Ubiq BI","og_description":"Often system administrators need to redirect URLs & web pages to another domain. Here is how to redirect location to another domain in NGINX.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2025-12-30T05:16:53+00:00","article_modified_time":"2026-01-20T05:15:30+00:00","og_image":[{"width":308,"height":204,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/redirect-url-to-new-domain-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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Redirect Location to Another Domain in NGINX","datePublished":"2025-12-30T05:16:53+00:00","dateModified":"2026-01-20T05:15:30+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/"},"wordCount":598,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/redirect-url-to-new-domain-nginx.jpg?fit=308%2C204&ssl=1","keywords":["redirect location"],"articleSection":["Nginx"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/","name":"How to Redirect Location to Another Domain in NGINX - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/redirect-url-to-new-domain-nginx.jpg?fit=308%2C204&ssl=1","datePublished":"2025-12-30T05:16:53+00:00","dateModified":"2026-01-20T05:15:30+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Often system administrators need to redirect URLs & web pages to another domain. Here is how to redirect location to another domain in NGINX.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/redirect-url-to-new-domain-nginx.jpg?fit=308%2C204&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/12\/redirect-url-to-new-domain-nginx.jpg?fit=308%2C204&ssl=1","width":308,"height":204,"caption":"redirect location to another domain in nginx"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Redirect Location to Another Domain 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\/redirect-url-to-new-domain-nginx.jpg?fit=308%2C204&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2Ec","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10180","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=10180"}],"version-history":[{"count":15,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10180\/revisions"}],"predecessor-version":[{"id":10325,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10180\/revisions\/10325"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/10194"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=10180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=10180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=10180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}