{"id":9728,"date":"2025-10-09T05:56:33","date_gmt":"2025-10-09T05:56:33","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=9728"},"modified":"2025-10-09T06:07:31","modified_gmt":"2025-10-09T06:07:31","slug":"remove-trailing-slash-in-nginx","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/","title":{"rendered":"How to Remove Trailing Slash in NGINX"},"content":{"rendered":"\n<p>NGINX is a powerful web server used by many websites, apps and blogs. It is scalable and supports heavy traffic. When you run your website on NGINX, you may notice that every requested URL is accessible whether or not you add a trailing slash to it. In both cases, NGINX will return the same response. This can be confusing and cause a few problems mentioned below. In this article, we will learn how to remove trailing slash in NGINX server.<\/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\/remove-trailing-slash-in-nginx\/#Why_Remove_Trailing_Slash_in_NGINX\" >Why Remove Trailing Slash 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\/remove-trailing-slash-in-nginx\/#How_to_Remove_Trailing_Slash_in_NGINX\" >How to Remove Trailing Slash 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\/remove-trailing-slash-in-nginx\/#Server-Side_Redirects\" >Server-Side Redirects<\/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\/remove-trailing-slash-in-nginx\/#CMS_Settings\" >CMS Settings<\/a><\/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\/remove-trailing-slash-in-nginx\/#Canonical_Tags\" >Canonical Tags<\/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\/remove-trailing-slash-in-nginx\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Remove_Trailing_Slash_in_NGINX\"><\/span>Why Remove Trailing Slash in NGINX<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are several reasons why you may need to remove trailing slash in URLs of your website. Let us look at some of the main ones.<\/p>\n\n\n\n<p>1. <strong>Duplicate Content<\/strong>: By default, search engines consider a URL with and without trailing slash as separate URLs, and crawl them separately. When they discover that both these URLs display the same content, then it is very likely that these URLs are seen as duplicates even though they are the same URL.<\/p>\n\n\n\n<p>2. <strong>Link Equity<\/strong>: Some backlinks may point to the URL with trailing slash while others may point to URLs without trailing slash. When both the URLs, with and without slash, are served on your site then the backlink power is split between these two URLs.<\/p>\n\n\n\n<p>3. <strong>Crawl Budget<\/strong>: Search engines do not crawl all pages on a website. They crawl only a limited number of pages at a time. It is known as <a href=\"https:\/\/backlinko.com\/hub\/seo\/crawl-budget\">crawl budget<\/a>. If they end up crawling URLs with and without trailing slash, then it will prevent other important and unique pages from being crawled and indexed.<\/p>\n\n\n\n<p>4. <strong>User Experience<\/strong>: Lastly, it is just confusing for users to remember whether your site&#8217;s URL has a trailing slash or not. It becomes difficult for them to link to share these URLs with others.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Remove_Trailing_Slash_in_NGINX\"><\/span>How to Remove Trailing Slash in NGINX<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are several ways to remove trailing slash in NGINX. Let us look at them one by one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Server-Side_Redirects\"><\/span>Server-Side Redirects<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>One of the most common and recommended solutions is to add a permanent 301 redirect from URL with trailing slash to URL without one. It returns a 301 response to search engines indicating the URL has permanently moved. This eliminates the problem of duplicate content. <\/p>\n\n\n\n<p>For this, open NGINX config file using text editor. It is typically located at \/etc\/nginx\/nginx.conf.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ vi \/etc\/nginx\/nginx.conf<\/pre>\n\n\n\n<p>If you use a virtual host, then open its configuration file at \/etc\/nginx\/sites-enabled\/<\/p>\n\n\n\n<p>In the server block, add the following line.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rewrite ^\/(.*)\/$ \/$1 permanent;<\/pre>\n\n\n\n<p>Let us look at the above command.<\/p>\n\n\n\n<p>^\/(.*)\/$ &#8211; Regular expression that matches any URL with a trailing slash.<\/p>\n\n\n\n<p>\/$1 &#8211; Format of new URL without trailing slash<\/p>\n\n\n\n<p>permanent &#8211; keyword to specify permanent redirection.<\/p>\n\n\n\n<p>Basically, the above directive tells NGINX to permanently redirect any URL that has a trailing slash. Save and close the file. You can add this directive to server, or location blocks. If you add it to a server block, then it will be applicable to all URLs served in the server. If you add it to a location block, then it will be applicable only to the URLs matched by the location block.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server{<br>  ...<br>  rewrite ^\/(.*)\/$ \/$1 permanent;<br>  ...<br>}<br><br>location \/ {<br>  ...<br>  rewrite ^\/(.*)\/$ \/$1 permanent;<br>  ...<br>}<\/pre>\n\n\n\n<p>Test NGINX configuration.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nginx -t<\/pre>\n\n\n\n<p>Restart NGINX server.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo service nginx reload<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CMS_Settings\"><\/span>CMS Settings<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Popular CMS (Content Management System) allow you to set the permalink format of your web pages, via their admin settings. In this, you can remove the trailing slash thereby removing it from all web pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Canonical_Tags\"><\/span>Canonical Tags<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Canonical tags help search engines determine the authoritative URL for a web page, in case it is accessible from multiple URLs. In fact, whether your URLs have trailing slashes or not, you must include canonical tag on your web pages. For example, let us say your URL is accessible from https:\/\/example.com\/about and https:\/\/example.com\/about\/, then you can set a canonical tag as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;link rel=\"canonical\" href=\"https:\/\/example.com\/about\" \/&gt;<\/pre>\n\n\n\n<p>Now, search engines know the original URL to be used for search indexing.<\/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 it is important to remove trailing slash from URLs. We have also learnt about the different ways to remove trailing slash in NGINX server. By default, all servers add trailing slashes to URLs. You need to explicitly update its configuration to remove trailing slashes to avoid duplicate content SEO penalty.<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/change-nginx-port-number-ubuntu\/\">How to Change Port Number in NGINX<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/enable-cors-nginx\/\">How to Enable CORS in NGINX<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/increase-request-timeout-nginx\/\">How to Increase Request Timeout in NGINX<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you may need to drop trailing slash in URLs. Here is how to remove trailing slash in NGINX server.<\/p>\n","protected":false},"author":1,"featured_media":9747,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[183],"class_list":["post-9728","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nginx","tag-trailing-slash"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Remove Trailing Slash in NGINX - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Sometimes you may need to drop trailing slash in URLs. Here is how to remove trailing slash in NGINX server.\" \/>\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\/remove-trailing-slash-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 Remove Trailing Slash in NGINX - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Sometimes you may need to drop trailing slash in URLs. Here is how to remove trailing slash in NGINX server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-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-10-09T05:56:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-09T06:07:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/remove-trailing-slash-nginx.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"301\" \/>\n\t<meta property=\"og:image:height\" content=\"201\" \/>\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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Remove Trailing Slash in NGINX\",\"datePublished\":\"2025-10-09T05:56:33+00:00\",\"dateModified\":\"2025-10-09T06:07:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/\"},\"wordCount\":726,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/remove-trailing-slash-nginx.jpg?fit=301%2C201&ssl=1\",\"keywords\":[\"trailing slash\"],\"articleSection\":[\"Nginx\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/\",\"name\":\"How to Remove Trailing Slash in NGINX - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/remove-trailing-slash-nginx.jpg?fit=301%2C201&ssl=1\",\"datePublished\":\"2025-10-09T05:56:33+00:00\",\"dateModified\":\"2025-10-09T06:07:31+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Sometimes you may need to drop trailing slash in URLs. Here is how to remove trailing slash in NGINX server.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/remove-trailing-slash-nginx.jpg?fit=301%2C201&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/remove-trailing-slash-nginx.jpg?fit=301%2C201&ssl=1\",\"width\":301,\"height\":201,\"caption\":\"remove trailing slash nginx\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/remove-trailing-slash-in-nginx\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Remove Trailing Slash 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 Remove Trailing Slash in NGINX - Ubiq BI","description":"Sometimes you may need to drop trailing slash in URLs. Here is how to remove trailing slash in NGINX server.","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\/remove-trailing-slash-in-nginx\/","og_locale":"en_US","og_type":"article","og_title":"How to Remove Trailing Slash in NGINX - Ubiq BI","og_description":"Sometimes you may need to drop trailing slash in URLs. Here is how to remove trailing slash in NGINX server.","og_url":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2025-10-09T05:56:33+00:00","article_modified_time":"2025-10-09T06:07:31+00:00","og_image":[{"width":301,"height":201,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/remove-trailing-slash-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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Remove Trailing Slash in NGINX","datePublished":"2025-10-09T05:56:33+00:00","dateModified":"2025-10-09T06:07:31+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/"},"wordCount":726,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/remove-trailing-slash-nginx.jpg?fit=301%2C201&ssl=1","keywords":["trailing slash"],"articleSection":["Nginx"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/","url":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/","name":"How to Remove Trailing Slash in NGINX - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/remove-trailing-slash-nginx.jpg?fit=301%2C201&ssl=1","datePublished":"2025-10-09T05:56:33+00:00","dateModified":"2025-10-09T06:07:31+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Sometimes you may need to drop trailing slash in URLs. Here is how to remove trailing slash in NGINX server.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/remove-trailing-slash-nginx.jpg?fit=301%2C201&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/remove-trailing-slash-nginx.jpg?fit=301%2C201&ssl=1","width":301,"height":201,"caption":"remove trailing slash nginx"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/remove-trailing-slash-in-nginx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Remove Trailing Slash 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\/10\/remove-trailing-slash-nginx.jpg?fit=301%2C201&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2wU","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/9728","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=9728"}],"version-history":[{"count":20,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/9728\/revisions"}],"predecessor-version":[{"id":9749,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/9728\/revisions\/9749"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/9747"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=9728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=9728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=9728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}