{"id":10292,"date":"2026-01-20T05:11:51","date_gmt":"2026-01-20T05:11:51","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=10292"},"modified":"2026-01-20T05:40:41","modified_gmt":"2026-01-20T05:40:41","slug":"rewrite-url-parameters-nginx","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/","title":{"rendered":"How to Rewrite URL Parameters in NGINX"},"content":{"rendered":"\n<p>NGINX rewrite rules allow you to redirect users from one URL to another. They are a very important way of informing the users that the requested resource has moved. Website administrators need to regularly redirect users from one URL to another, in case the website is re-organized. In this article, we will learn why you need to rewrite URL parameters in NGINX and the different ways 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\/rewrite-url-parameters-nginx\/#Why_Rewrite_URL_Parameters\" >Why Rewrite URL Parameters<\/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\/rewrite-url-parameters-nginx\/#Return_vs_Redirect_Directive\" >Return vs Redirect Directive<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#Return_Directive\" >Return Directive<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#Rewrite_Directive\" >Rewrite Directive<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#How_to_Rewrite_URL_Parameters_in_NGINX\" >How to Rewrite URL Parameters in NGINX<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#Using_Rewrite\" >Using Rewrite<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#Rewrite_from_parameter-based_URL_to_path-based_URL\" >Rewrite from parameter-based URL to path-based URL<\/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\/rewrite-url-parameters-nginx\/#Rewrite_from_path-based_URL_to_parameter-based_URL\" >Rewrite from path-based URL to parameter-based URL<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#Using_Return\" >Using Return<\/a><\/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\/rewrite-url-parameters-nginx\/#Conclusion\" >Conclusion<\/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\/rewrite-url-parameters-nginx\/#FAQs\" >FAQs<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Rewrite_URL_Parameters\"><\/span>Why Rewrite URL Parameters<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are several reasons why you may need to rewrite URL in NGINX. Here are some of the common reasons:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Website restructuring<\/strong> &#8211; Often site administrators and web developers need to re-organize web pages on their site to make it easier to browse for users and crawl for search engines. In such cases, you will need to rewrite URL parameters to redirect users from old pages to new pages.<\/li>\n\n\n\n<li><strong>Moving web pages<\/strong> &#8211; Sometimes you genuinely need to move one or more web pages from one location to another. In such cases, you need to rewrite URL along with its parameters.<\/li>\n\n\n\n<li><strong>Remove Outdated content<\/strong> &#8211; If your site is content-heavy with regularly published content, then over time, some of it may become outdated. In such cases, you may need to rewrite a fresh piece on the topic and redirect old URL to new one.<\/li>\n\n\n\n<li><strong>URL structure change<\/strong> &#8211; Sometimes, the entire structure of your website&#8217;s URL needs to be changed to make it more intuitive for both users and search engines. In such cases, you need to rewrite URL parameters in NGINX.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Return_vs_Redirect_Directive\"><\/span>Return vs Redirect Directive<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>NGINX provides two ways to rewrite URL parameters in NGINX &#8211; return statement and rewrite statement. It is important to understand them properly before we proceed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Return_Directive\"><\/span>Return Directive<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The Return directive stops processing the request and returns a specific response code (e.g. 301, 302) along with the new URL, to the client web browser. Then the client browser sends another request to this new URL. This is how URL redirection occurs with return directive. Since the browser needs to make a separate request to new URL, the URL in address bar changes.<\/p>\n\n\n\n<p>Return statement is useful for simple use cases such as forcing HTTP to HTTPS or completely migrating website to a new domain. For more complex use cases, you need to use Return directive.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Rewrite_Directive\"><\/span>Rewrite Directive<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In case of rewrite directive, the redirection happens internally in the server. Here the server will perform redirection and return response code along with the new page&#8217;s contents to the client browser. So the redirection happens without changing the address bar URL.<\/p>\n\n\n\n<p>Rewrite statement is used for complex scenarios such as where you need to perform regular expression matching to extract a part of original URL. Other use cases involve using multiple rewrite statements within the same context, or creating pretty links for ugly URLs in <a href=\"https:\/\/www.ibm.com\/think\/topics\/content-management-system\" target=\"_blank\" rel=\"noreferrer noopener\">content management system<\/a> or E-commerce site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Rewrite_URL_Parameters_in_NGINX\"><\/span>How to Rewrite URL Parameters in NGINX<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let us look at the steps to rewrite URL parameters in NGINX.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Using_Rewrite\"><\/span>Using Rewrite<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can use rewrite directive to easily rewrite URL parameters, using regular expressions and back references. Here is the syntax for rewrite directive.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rewrite regex replacement-url [flag];<\/pre>\n\n\n\n<p>In the above directive,<br>regex &#8211;  regular expression used to match requested URL<br>replacement-url &#8211; the new url string to be used for matching requests<br>flag &#8211; decides whether to process further rewrite requests or not<\/p>\n\n\n\n<p>You can place this directive in server or location blocks. Let us look at two use cases &#8211; where we redirect from parameter-based URL to a path-based URL and vice versa.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Rewrite_from_parameter-based_URL_to_path-based_URL\"><\/span>Rewrite from parameter-based URL to path-based URL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Let us say you want to redirect \/product.php?id=4 to \/product\/4<\/p>\n\n\n\n<p>In the above case, we use regular expression along with parameter name to capture parameter value. So place the following line in server or location block.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location = \/product.php {<br>    rewrite ^\/product\\.php\\?id=(\\d+)$ \/user\/$1 permanent<br>}<\/pre>\n\n\n\n<p>Let us look at the above code in detail.<\/p>\n\n\n\n<p>^ &#8211; beginning with <br>$ &#8211; ending with <br>\\d+ &#8211; match one or more digits<br>(\\d+) &#8211; capture digits using back reference<br>$1 &#8211; uses value of first group<br>permanent &#8211; permanent redirection, HTTP response code 301<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Rewrite_from_path-based_URL_to_parameter-based_URL\"><\/span>Rewrite from path-based URL to parameter-based URL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Let us say you want to redirect from \/product\/4 to product.php?id=4<\/p>\n\n\n\n<p>In this case, we use regular expression to capture path segments and use them as parameters in URL. For this purpose, add the following rewrite directive in location block as shown.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location \/product\/ {<br>    rewrite ^\/product\/(\\d+)\/?$ \/product.php?id=$1 last<br>}<\/pre>\n\n\n\n<p>Let us look at the above code in detail.<\/p>\n\n\n\n<p>$1 &#8211; captured parameter<br>^  &#8211; beginning with<br>$ &#8211; ending with<br>(\\d+) &#8211; digits in URL path after \/product\/<br>last &#8211; stops processing rewrite directives and redirect to new location<\/p>\n\n\n\n<p>If you want to remove all parameters from URL, then use the following rewrite directive.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rewrite ^\/old-path \/new-path? permanent;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Using_Return\"><\/span>Using Return<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Return directive is useful to implement simple redirects. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">return response_code old-url new-url;<\/pre>\n\n\n\n<p>For example, let us say you want to redirect a group of parameter-based URLs to a single page, then you can simply use return directive. Let us say you want to return parameterized pages to \/product.php (\/product.php?id=11, \/product.php?id=12, etc) to \/products. You can easily do this using return statement as shown.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location = \/product.php {<br>    return 301 $scheme:\/\/example.com\/products<br>}<\/pre>\n\n\n\n<p>In the above code, the location block will match all parameterized URLs starting with \/product.php. Then it returns them to \/products page.<\/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 why you need to redirect users on your website. We have also learnt how to implement this in NGINX &#8211; using return and rewrite statements. We have learnt about the difference between return and rewrite statement. Depending on your requirement, you can use any of the methods described above.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>1. When to use Rewrite Statement<\/strong><br>Rewrite statement is useful to match one or more URLs, fetch their URL parameters and redirect them to path-based URLs created using the parameter values. On the other hand, it is also useful to extract path values from path-based URLs and redirect them to parameter-based URLs created using the path values.<\/p>\n\n\n\n<p><strong>2. When to use Return Statement<\/strong><br>Return statement is useful when you need to migrate all or most of your web pages to a new location. It is also useful for canonicalization of similar URLs. You can also use it where you just need to simply redirect a bunch of known URLs to a single page.<\/p>\n\n\n\n<p>Also Read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-redirect-location-to-another-domain-in-nginx\/\">How to Redirect Location to Another Domain<\/a><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><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you may need to rewrite URL parameters in NGINX server. Here are the steps to do this.<\/p>\n","protected":false},"author":1,"featured_media":10307,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[624],"class_list":["post-10292","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nginx","tag-rewrite-url-parameters"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Rewrite URL Parameters in NGINX - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Sometimes you may need to rewrite URL parameters 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\/rewrite-url-parameters-nginx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Rewrite URL Parameters in NGINX - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Sometimes you may need to rewrite URL parameters in NGINX server. Here are the steps to do this.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-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=\"2026-01-20T05:11:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-20T05:40:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/01\/rewrite-url-parameters-nginx.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"375\" \/>\n\t<meta property=\"og:image:height\" content=\"202\" \/>\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\\\/rewrite-url-parameters-nginx\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Rewrite URL Parameters in NGINX\",\"datePublished\":\"2026-01-20T05:11:51+00:00\",\"dateModified\":\"2026-01-20T05:40:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/\"},\"wordCount\":1068,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/rewrite-url-parameters-nginx.jpg?fit=375%2C202&ssl=1\",\"keywords\":[\"rewrite url parameters\"],\"articleSection\":[\"Nginx\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/\",\"name\":\"How to Rewrite URL Parameters in NGINX - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/rewrite-url-parameters-nginx.jpg?fit=375%2C202&ssl=1\",\"datePublished\":\"2026-01-20T05:11:51+00:00\",\"dateModified\":\"2026-01-20T05:40:41+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Sometimes you may need to rewrite URL parameters in NGINX server. Here are the steps to do this.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/rewrite-url-parameters-nginx.jpg?fit=375%2C202&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/rewrite-url-parameters-nginx.jpg?fit=375%2C202&ssl=1\",\"width\":375,\"height\":202,\"caption\":\"rewrite url parameters in nginx\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/rewrite-url-parameters-nginx\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Rewrite URL Parameters 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 Rewrite URL Parameters in NGINX - Ubiq BI","description":"Sometimes you may need to rewrite URL parameters 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\/rewrite-url-parameters-nginx\/","og_locale":"en_US","og_type":"article","og_title":"How to Rewrite URL Parameters in NGINX - Ubiq BI","og_description":"Sometimes you may need to rewrite URL parameters in NGINX server. Here are the steps to do this.","og_url":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2026-01-20T05:11:51+00:00","article_modified_time":"2026-01-20T05:40:41+00:00","og_image":[{"width":375,"height":202,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/01\/rewrite-url-parameters-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\/rewrite-url-parameters-nginx\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Rewrite URL Parameters in NGINX","datePublished":"2026-01-20T05:11:51+00:00","dateModified":"2026-01-20T05:40:41+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/"},"wordCount":1068,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/01\/rewrite-url-parameters-nginx.jpg?fit=375%2C202&ssl=1","keywords":["rewrite url parameters"],"articleSection":["Nginx"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/","url":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/","name":"How to Rewrite URL Parameters in NGINX - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/01\/rewrite-url-parameters-nginx.jpg?fit=375%2C202&ssl=1","datePublished":"2026-01-20T05:11:51+00:00","dateModified":"2026-01-20T05:40:41+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Sometimes you may need to rewrite URL parameters in NGINX server. Here are the steps to do this.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/01\/rewrite-url-parameters-nginx.jpg?fit=375%2C202&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/01\/rewrite-url-parameters-nginx.jpg?fit=375%2C202&ssl=1","width":375,"height":202,"caption":"rewrite url parameters in nginx"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/rewrite-url-parameters-nginx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Rewrite URL Parameters 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\/2026\/01\/rewrite-url-parameters-nginx.jpg?fit=375%2C202&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2G0","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10292","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=10292"}],"version-history":[{"count":32,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10292\/revisions"}],"predecessor-version":[{"id":10341,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10292\/revisions\/10341"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/10307"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=10292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=10292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=10292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}