CINXE.COM
<!doctype html> <html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-http/traffic-policy/actions/url-rewrite" data-has-hydrated="false"> <head> <meta charset="UTF-8"> <meta name="generator" content="Docusaurus v3.5.2"> <title data-rh="true">URL Rewrite | ngrok documentation</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://ngrok.com/docs/img/ngrok-docs-opengraph.png"><meta data-rh="true" name="twitter:image" content="https://ngrok.com/docs/img/ngrok-docs-opengraph.png"><meta data-rh="true" property="og:url" content="https://ngrok.com/docs/http/traffic-policy/actions/url-rewrite/"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="keywords" content="ngrok, documentation, api, errors, reference, getting started, tutorials"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="URL Rewrite | ngrok documentation"><meta data-rh="true" name="description" content="Action Result Variables"><meta data-rh="true" property="og:description" content="Action Result Variables"><link data-rh="true" rel="icon" href="/docs/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://ngrok.com/docs/http/traffic-policy/actions/url-rewrite/"><link data-rh="true" rel="alternate" href="https://ngrok.com/docs/http/traffic-policy/actions/url-rewrite/" hreflang="en"><link data-rh="true" rel="alternate" href="https://ngrok.com/docs/http/traffic-policy/actions/url-rewrite/" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://8D7MHVMLBR-dsn.algolia.net" crossorigin="anonymous"><link rel="preconnect" href="https://www.googletagmanager.com"> <script>window.dataLayer=window.dataLayer||[]</script> <script>!function(e,t,a,n){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var g=t.getElementsByTagName(a)[0],m=t.createElement(a);m.async=!0,m.src="https://www.googletagmanager.com/gtm.js?id=GTM-P4F37ZW",g.parentNode.insertBefore(m,g)}(window,document,"script","dataLayer")</script> <script id="hs-script-loader" src="//js.hs-scripts.com/21124867.js"></script> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/euclid-square/EuclidSquare-Regular-WebS.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/euclid-square/EuclidSquare-RegularItalic-WebS.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/euclid-square/EuclidSquare-Medium-WebS.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/euclid-square/EuclidSquare-Semibold-WebS.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/euclid-square/EuclidSquare-MediumItalic-WebS.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/ibm-plex-mono/IBMPlexMono-Text.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/ibm-plex-mono/IBMPlexMono-TextItalic.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/ibm-plex-mono/IBMPlexMono-SemiBold.woff" as="font" type="font/woff" crossorigin="anonymous"> <link rel="preload" href="https://cdn.ngrok.com/static/fonts/ibm-plex-mono/IBMPlexMono-SemiBoldItalic.woff" as="font" type="font/woff" crossorigin="anonymous"> <script src="/docs/scripts/ketch.js"></script> <script src="https://global.ketchcdn.com/web/v2/config/ngrok/ngrok_ketch_tag/boot.js" async defer="defer"></script> <script src="/docs/scripts/fix-redirect.js" async></script> <script src="/docs/scripts/anchor-scroll-to.js" async></script> <script src="https://tag.clearbitscripts.com/v1/pk_1caf9e9fb3222466245fb17c8f807837/tags.js"></script><link rel="stylesheet" href="/docs/assets/css/styles.13d6ab4e.css"> <script src="/docs/assets/js/runtime~main.36fd4022.js" defer="defer"></script> <script src="/docs/assets/js/main.94660bb2.js" defer="defer"></script> </head> <body class="navigation-with-keyboard"> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P4F37ZW" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var[t,e]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_IipK" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a href="https://ngrok.com" target="_blank" rel="noopener noreferrer" class="navbar__brand"><div class="navbar__logo"><img src="/docs/img/ngrok-black.svg" alt="ngrok" class="themedComponent_Az_r themedComponent--light_ik9_"><img src="/docs/img/ngrok-white.svg" alt="ngrok" class="themedComponent_Az_r themedComponent--dark_eDvw"></div></a><a href="https://ngrok.com/product/platform" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Platform</a><a href="https://ngrok.com/use-cases" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Use cases</a><a href="https://ngrok.com/blog" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Blog</a><a href="https://ngrok.com/resources" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Resources</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/">Docs</a><a href="https://ngrok.com/pricing" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Pricing</a><a href="https://download.ngrok.com" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Get ngrok</a></div><div class="navbar__items navbar__items--right"><a href="https://dashboard.ngrok.com/login" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link dev-portal-login dev-portal-link">Log in</a><a href="https://ngrok.com/signup" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link dev-portal-signup dev-portal-link">Sign Up</a><div class="toggle_DITL colorModeToggle_bvw4"><button class="clean-btn toggleButton_bazi toggleButtonDisabled_IzIM" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_j6C1"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_uFh4"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="navbarSearchContainer_nbxA"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_pOYi"><div class="docsWrapper_kVRX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_OuIh" type="button"></button><div class="docRoot_v94m"><aside class="theme-doc-sidebar-container docSidebarContainer_JlOU"><div class="sidebarViewport_A_zS"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button><div class="sidebar_idex"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_nVoB"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/">Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/what-is-ngrok/">What is ngrok?</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/how-ngrok-works/">How does ngrok work?</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/why-ngrok/">Why ngrok?</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/whats-new/">What's new?</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/getting-started/">Getting Started</a><button aria-label="Expand sidebar category 'Getting Started'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><div class="menu__section">Endpoints</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" href="/docs/http/">HTTP</a><button aria-label="Collapse sidebar category 'HTTP'" aria-expanded="true" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/">Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/basic-auth/">Basic Auth</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/circuit-breaker/">Circuit Breaker</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/compression/">Compression</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/ip-restrictions/">IP Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/mutual-tls/">Mutual TLS</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/oauth/">OAuth</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/openid-connect/">OpenID Connect</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/request-headers/">Request Headers</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/response-headers/">Response Headers</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/saml/">SAML</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/tls-termination/">TLS Termination</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" tabindex="0" href="/docs/http/traffic-policy/">Traffic Policy</a><button aria-label="Collapse sidebar category 'Traffic Policy'" aria-expanded="true" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/">Overview</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" tabindex="0" href="/docs/http/traffic-policy/expressions/">Expressions</a><button aria-label="Expand sidebar category 'Expressions'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" tabindex="0" href="/docs/http/traffic-policy/actions/">Actions</a><button aria-label="Collapse sidebar category 'Actions'" aria-expanded="true" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/">Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/add-headers/">Add Headers</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/basic-auth/">Basic Authentication</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/circuit-breaker/">Circuit Breaker</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/compress-response/">Compress Response</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/custom-response/">Custom Response</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/deny/">Deny</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/forward-internal/">Forward Internal</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/jwt-validation/">JWT Validation</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/log/">Log</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/rate-limit/">Rate Limit</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/redirect/">Redirect</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/remove-headers/">Remove Headers</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/restrict-ips/">Restrict IPs</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/http/traffic-policy/actions/url-rewrite/">URL Rewrite</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/actions/verify-webhook/">Verify Webhook</a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/traffic-policy/gallery/">Rule Gallery</a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/user-agent-filter/">User Agent Filter</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/webhook-verification/">Webhook Verification</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/http/websocket-tcp-converter/">Websocket TCP Converter</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/tls/">TLS</a><button aria-label="Expand sidebar category 'TLS'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/tcp/">TCP</a><button aria-label="Expand sidebar category 'TCP'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><div class="menu__section">Connectivity</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/agent/">Agent</a><button aria-label="Expand sidebar category 'Agent'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/agent-sdks/">Agent SDKs</a><button aria-label="Expand sidebar category 'Agent SDKs'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/k8s/">Kubernetes</a><button aria-label="Expand sidebar category 'Kubernetes'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><div class="menu__section">Platform</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/network-edge/">Network Edge</a><button aria-label="Expand sidebar category 'Network Edge'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/api/">API</a><button aria-label="Expand sidebar category 'API'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/obs/">Observability</a><button aria-label="Expand sidebar category 'Observability'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/iam/">IAM</a><button aria-label="Expand sidebar category 'IAM'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/errors/">Errors</a><button aria-label="Expand sidebar category 'Errors'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><div class="menu__section">Walkthroughs</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/guides/">Guides</a><button aria-label="Expand sidebar category 'Guides'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/integrations/">Integrations</a><button aria-label="Expand sidebar category 'Integrations'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1"><div class="menu__section"></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/faq/">FAQ</a></li></ul></nav></div></div></aside><main class="docMainContainer_HBBy"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_dNMx"><div class="docItemContainer_iJh1"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_SKcw" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/docs/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_ZMzL"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/http/"><span itemprop="name">HTTP</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/http/traffic-policy/"><span itemprop="name">Traffic Policy</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/http/traffic-policy/actions/"><span itemprop="name">Actions</span></a><meta itemprop="position" content="3"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">URL Rewrite</span><meta itemprop="position" content="4"></li></ul></nav><div class="tocCollapsible_AX1Z theme-doc-toc-mobile tocMobile_HCfs"><button type="button" class="clean-btn tocCollapsibleButton_gEwV">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>URL Rewrite</h1></header> <h2 class="anchor anchorWithStickyNavbar_qeIy" id="overview">Overview<a href="#overview" class="hash-link" aria-label="Direct link to Overview" title="Direct link to Overview"></a></h2> <p>The <strong>URL Rewrite</strong> Traffic Policy action enables you to modify the incoming request URL using regular expressions before it reaches the upstream server, without changing the URL seen by the client.</p> <p>This action is useful for routing users without exposing internal system details.</p> <h2 class="anchor anchorWithStickyNavbar_qeIy" id="configuration-reference">Configuration Reference<a href="#configuration-reference" class="hash-link" aria-label="Direct link to Configuration Reference" title="Direct link to Configuration Reference"></a></h2> <p>This is the <a href="/docs/http/traffic-policy/">Traffic Policy</a> configuration reference for this action.</p> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="action-type">Action Type<a href="#action-type" class="hash-link" aria-label="Direct link to Action Type" title="Direct link to Action Type"></a></h3> <p><code>url-rewrite</code></p> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="configuration-fields">Configuration Fields<a href="#configuration-fields" class="hash-link" aria-label="Direct link to Configuration Fields" title="Direct link to Configuration Fields"></a></h3> <table><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>from</code></td><td><code>string</code></td><td><strong>Required.</strong> A regular expression string to match inside of the URL. Supports <a href="#cel-interpolation">CEL Interpolation</a>.</td></tr><tr><td><code>to</code></td><td><code>string</code></td><td><strong>Required.</strong> A regular expression string to replace the <code>from</code> match with. Supports <a href="#cel-interpolation">CEL Interpolation</a>.</td></tr><tr><td><code>format</code></td><td><code>string</code></td><td>Determines interpolation format in <code>to</code>/<code>from</code> fields. Default <code>ngrok</code>.</td></tr></tbody></table> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="supported-phases">Supported Phases<a href="#supported-phases" class="hash-link" aria-label="Direct link to Supported Phases" title="Direct link to Supported Phases"></a></h3> <ul> <li><code>on_http_request</code></li> </ul> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="supported-schemes">Supported Schemes<a href="#supported-schemes" class="hash-link" aria-label="Direct link to Supported Schemes" title="Direct link to Supported Schemes"></a></h3> <ul> <li><code>https</code></li> <li><code>http</code></li> </ul> <h2 class="anchor anchorWithStickyNavbar_qeIy" id="behavior">Behavior<a href="#behavior" class="hash-link" aria-label="Direct link to Behavior" title="Direct link to Behavior"></a></h2> <p>This action replaces all matches of the<code>from</code> regular expression in the request URL with the<code>to</code> replacement value.</p> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="matching">Matching<a href="#matching" class="hash-link" aria-label="Direct link to Matching" title="Direct link to Matching"></a></h3> <p>Matching is done against the full URL, including the scheme, userinfo, host, and port, not just the path.</p> <p>To match requests that start with <code>/products</code> you must use <a href="#cel-interpolation">CEL Interpolation</a> and write <code>^${req.url.authority}/products</code> or use an expression like <code>req.url.path.startsWith('/products')</code> in the policy rule <code>expressions</code> field.</p> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="cel-interpolation">CEL Interpolation<a href="#cel-interpolation" class="hash-link" aria-label="Direct link to CEL Interpolation" title="Direct link to CEL Interpolation"></a></h3> <p>You can access Traffic Policy variables and embed CEL expressions in this actions configuration values using CEL Interpolation in the form of <code>${expression}</code>. Check out <a href="#examples">the examples below</a> to see how CEL Interpolation works.</p> <p><strong>Note:</strong> All CEL Interpolation will occur <strong>before</strong> regular expressions are evaluated.</p> <p>For a complete list of variables and how to write expressions, see <a href="/docs/http/traffic-policy/expressions/variables/">Expressions</a> and <a href="/docs/http/traffic-policy/expressions/">Variables</a> documentation.</p> <h2 class="anchor anchorWithStickyNavbar_qeIy" id="examples">Examples<a href="#examples" class="hash-link" aria-label="Direct link to Examples" title="Direct link to Examples"></a></h2> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="rewrite-using-paths">Rewrite using Paths<a href="#rewrite-using-paths" class="hash-link" aria-label="Direct link to Rewrite using Paths" title="Direct link to Rewrite using Paths"></a></h3> <p>The following <a href="/docs/http/traffic-policy/">Traffic Policy</a> configuration demonstrates how to use the <code>url-rewrite</code> action to transparently rewrite the request URL from <code>/products</code> to <code>/products.php</code>.</p> <h4 class="anchor anchorWithStickyNavbar_qeIy" id="example-traffic-policy-document">Example Traffic Policy Document<a href="#example-traffic-policy-document" class="hash-link" aria-label="Direct link to Example Traffic Policy Document" title="Direct link to Example Traffic Policy Document"></a></h4> <div class="tabs-container tabList_KpEJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_Vj3_ tabs__item--active">YAML</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_MH1p"><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0 codeBlockLinesWithNumbering_ZkiZ"><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">on_http_request</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">expressions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"req.url.path == '/products'"</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">actions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"url-rewrite"</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">config</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">from</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/products"</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">to</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/products.php"</span></span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0 codeBlockLinesWithNumbering_ZkiZ"><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"on_http_request"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"expressions"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token string" style="color:#e3116c">"req.url.path == '/products'"</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"actions"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"type"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"url-rewrite"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"config"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"from"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/products"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"to"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/products.php"</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span></span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div> <p>This configuration will rewrite any request to <code>/products</code> to <code>/products.php</code> without changing the URL seen by the client. This is useful for hiding away the underlying implementation details of your service.</p> <h4 class="anchor anchorWithStickyNavbar_qeIy" id="example-request">Example Request<a href="#example-request" class="hash-link" aria-label="Direct link to Example Request" title="Direct link to Example Request"></a></h4> <div class="language-shell codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-shell codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">$ </span><span class="token function" style="color:#d73a49">curl</span><span class="token plain"> </span><span class="token parameter variable" style="color:#36acaa">-i</span><span class="token plain"> https://example.ngrok.app/products</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <div class="language-http codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-http codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token response-status http-version property" style="color:#36acaa">HTTP/2</span><span class="token response-status"> </span><span class="token response-status status-code number" style="color:#36acaa">200</span><span class="token response-status"> </span><span class="token response-status reason-phrase string" style="color:#e3116c">OK</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <h5 class="anchor anchorWithStickyNavbar_qeIy" id="example-server-logs">Example Server Logs<a href="#example-server-logs" class="hash-link" aria-label="Direct link to Example Server Logs" title="Direct link to Example Server Logs"></a></h5> <div class="language-http codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-http codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">GET /product.php 200 OK</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <h4 class="anchor anchorWithStickyNavbar_qeIy" id="conclusion">Conclusion<a href="#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h4> <p>In this example, a request to <code>/products</code> is internally routed to <code>/products.php</code>, and the response is served from <code>products.php</code> while the client remains unaware of the URL rewrite.</p> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="rewrite-using-regular-expressions">Rewrite using Regular Expressions<a href="#rewrite-using-regular-expressions" class="hash-link" aria-label="Direct link to Rewrite using Regular Expressions" title="Direct link to Rewrite using Regular Expressions"></a></h3> <p>The following <a href="/docs/http/traffic-policy/">Traffic Policy</a> configuration demonstrates how to use the <code>url-rewrite</code> action to transparently rewrite the request URL from <code>/products/*</code> to <code>/products.php</code>.</p> <h4 class="anchor anchorWithStickyNavbar_qeIy" id="example-traffic-policy-document">Example Traffic Policy Document<a href="#example-traffic-policy-document" class="hash-link" aria-label="Direct link to Example Traffic Policy Document" title="Direct link to Example Traffic Policy Document"></a></h4> <div class="tabs-container tabList_KpEJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_Vj3_ tabs__item--active">YAML</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_MH1p"><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0 codeBlockLinesWithNumbering_ZkiZ"><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">on_http_request</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">expressions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"req.url.path.startsWith('/products')"</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">actions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"url-rewrite"</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">config</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">from</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/products/?([.*]+)?"</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">to</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/products.php?query=$1"</span></span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0 codeBlockLinesWithNumbering_ZkiZ"><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"on_http_request"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"expressions"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token string" style="color:#e3116c">"req.url.path.startsWith('/products')"</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"actions"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"type"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"url-rewrite"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"config"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"from"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/products/?([.*]+)?"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"to"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/products.php?query=$1"</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span></span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div> <p>This configuration will rewrite any request to <code>/products/*</code> to <code>/products.php?query=$1</code> without changing the URL seen by the client. This is useful for hiding away the underlying implementation details of your service.</p> <h4 class="anchor anchorWithStickyNavbar_qeIy" id="example-request">Example Request<a href="#example-request" class="hash-link" aria-label="Direct link to Example Request" title="Direct link to Example Request"></a></h4> <div class="language-shell codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-shell codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">$ </span><span class="token function" style="color:#d73a49">curl</span><span class="token plain"> </span><span class="token parameter variable" style="color:#36acaa">-i</span><span class="token plain"> https://example.ngrok.app/products/123</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <div class="language-http codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-http codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token response-status http-version property" style="color:#36acaa">HTTP/2</span><span class="token response-status"> </span><span class="token response-status status-code number" style="color:#36acaa">200</span><span class="token response-status"> </span><span class="token response-status reason-phrase string" style="color:#e3116c">OK</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <h5 class="anchor anchorWithStickyNavbar_qeIy" id="example-server-logs">Example Server Logs<a href="#example-server-logs" class="hash-link" aria-label="Direct link to Example Server Logs" title="Direct link to Example Server Logs"></a></h5> <div class="language-http codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-http codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">GET /product.php?query=123 200 OK</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <h4 class="anchor anchorWithStickyNavbar_qeIy" id="conclusion">Conclusion<a href="#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h4> <p>In this example, a request to <code>/products</code> is internally routed to <code>/products.php?query=123</code>, and the response is served from <code>products.php</code> while the client remains unaware of the URL rewrite.</p> <h3 class="anchor anchorWithStickyNavbar_qeIy" id="rewrite-using-cel-interpolation">Rewrite using CEL Interpolation<a href="#rewrite-using-cel-interpolation" class="hash-link" aria-label="Direct link to Rewrite using CEL Interpolation" title="Direct link to Rewrite using CEL Interpolation"></a></h3> <p>The following <a href="/docs/http/traffic-policy/">Traffic Policy</a> configuration demonstrates how to use the <code>url-rewrite</code> action to transparently rewrite the request URL from <code>/products/*</code> to <code>/products.php</code> using a global policy rule (no expression) by leveraging <a href="#cel-interpolation">CEL Interpolation</a>.</p> <h4 class="anchor anchorWithStickyNavbar_qeIy" id="example-traffic-policy-document">Example Traffic Policy Document<a href="#example-traffic-policy-document" class="hash-link" aria-label="Direct link to Example Traffic Policy Document" title="Direct link to Example Traffic Policy Document"></a></h4> <div class="tabs-container tabList_KpEJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_Vj3_ tabs__item--active">YAML</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_Vj3_">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_MH1p"><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0 codeBlockLinesWithNumbering_ZkiZ"><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">on_http_request</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">actions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"url-rewrite"</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">config</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">from</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"${req.url.authority}/products/?([.*]+)?"</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">to</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/products.php?query=$1"</span></span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_MH1p" hidden=""><div class="language-yaml codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-yaml codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0 codeBlockLinesWithNumbering_ZkiZ"><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"on_http_request"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"actions"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"type"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"url-rewrite"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"config"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"from"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"${req.url.authority}/products/?([.*]+)?"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">"to"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"/products.php?query=$1"</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span></span><br></span><span class="token-line theme-code-block-highlighted-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span></span><br></span><span class="token-line codeLine_n6D4" style="color:#393A34"><span class="codeLineNumber_zzdQ"></span><span class="codeLineContent_J2Jz"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span></span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div> <p>This configuration will rewrite any request urls that start with <code>/products/*</code> to <code>/products.php?query=$1</code> without changing the URL seen by the client. It does this by leveraging <a href="#cel-interpolation">CEL Interpolation</a> to replace the <code>from</code> value with the request URL authority. This is useful for hiding away the underlying implementation details of your service.</p> <h4 class="anchor anchorWithStickyNavbar_qeIy" id="example-request">Example Request<a href="#example-request" class="hash-link" aria-label="Direct link to Example Request" title="Direct link to Example Request"></a></h4> <div class="language-shell codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-shell codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">$ </span><span class="token function" style="color:#d73a49">curl</span><span class="token plain"> </span><span class="token parameter variable" style="color:#36acaa">-i</span><span class="token plain"> https://example.ngrok.app/products/123</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <div class="language-http codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-http codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token response-status http-version property" style="color:#36acaa">HTTP/2</span><span class="token response-status"> </span><span class="token response-status status-code number" style="color:#36acaa">200</span><span class="token response-status"> </span><span class="token response-status reason-phrase string" style="color:#e3116c">OK</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <h5 class="anchor anchorWithStickyNavbar_qeIy" id="example-server-logs">Example Server Logs<a href="#example-server-logs" class="hash-link" aria-label="Direct link to Example Server Logs" title="Direct link to Example Server Logs"></a></h5> <div class="language-http codeBlockContainer_eHBk theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_feMQ"><pre tabindex="0" class="prism-code language-http codeBlock_HtbR thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_JKK0"><span class="token-line" style="color:#393A34"><span class="token plain">GET /product.php?query=123 200 OK</span><br></span></code></pre><div class="buttonGroup_Ug71"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_c3my" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y0ux"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_mLQu"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <h4 class="anchor anchorWithStickyNavbar_qeIy" id="conclusion">Conclusion<a href="#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion"></a></h4> <p>In this example, a request to <code>/products</code> is internally routed to <code>/products.php?query=123</code>, and the response is served from <code>products.php</code> while the client remains unaware of the URL rewrite.</p> <h2 class="anchor anchorWithStickyNavbar_qeIy" id="action-result-variables">Action Result Variables<a href="#action-result-variables" class="hash-link" aria-label="Direct link to Action Result Variables" title="Direct link to Action Result Variables"></a></h2> <p>The following variables are made available for use in subsequent expressions and CEL interpolations after the action has run. Variable values will only apply to the last action execution, results are not concatenated.</p> <table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>actions.ngrok.url_rewrite.matches</code></td><td><code>[]string</code></td><td>List of matched elements.</td></tr><tr><td><code>actions.ngrok.url_rewrite.url</code></td><td><code>string</code></td><td>The resulting URL after it was re-written.</td></tr><tr><td><code>actions.ngrok.url_rewrite.error.code</code></td><td><code>string</code></td><td>Code for an error that occurred during the invocation of an action.</td></tr><tr><td><code>actions.ngrok.url_rewrite.error.message</code></td><td><code>string</code></td><td>Message for an error that occurred during the invocation of an action.</td></tr></tbody></table></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col"><a href="https://github.com/ngrok/ngrok-docs/edit/main/docs/http/traffic-policy/actions/url-rewrite.mdx" target="_blank" rel="noopener noreferrer" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_pNyv" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_wOM1"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2024-11-26T19:41:31.000Z" itemprop="dateModified">Nov 26, 2024</time></b> by <b>samcrichard</b></span></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/http/traffic-policy/actions/restrict-ips/"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Restrict IPs</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/http/traffic-policy/actions/verify-webhook/"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Verify Webhook</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_iEsB thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#overview" class="table-of-contents__link toc-highlight">Overview</a></li><li><a href="#configuration-reference" class="table-of-contents__link toc-highlight">Configuration Reference</a><ul><li><a href="#action-type" class="table-of-contents__link toc-highlight">Action Type</a></li><li><a href="#configuration-fields" class="table-of-contents__link toc-highlight">Configuration Fields</a></li><li><a href="#supported-phases" class="table-of-contents__link toc-highlight">Supported Phases</a></li><li><a href="#supported-schemes" class="table-of-contents__link toc-highlight">Supported Schemes</a></li></ul></li><li><a href="#behavior" class="table-of-contents__link toc-highlight">Behavior</a><ul><li><a href="#matching" class="table-of-contents__link toc-highlight">Matching</a></li><li><a href="#cel-interpolation" class="table-of-contents__link toc-highlight">CEL Interpolation</a></li></ul></li><li><a href="#examples" class="table-of-contents__link toc-highlight">Examples</a><ul><li><a href="#rewrite-using-paths" class="table-of-contents__link toc-highlight">Rewrite using Paths</a></li><li><a href="#rewrite-using-regular-expressions" class="table-of-contents__link toc-highlight">Rewrite using Regular Expressions</a></li><li><a href="#rewrite-using-cel-interpolation" class="table-of-contents__link toc-highlight">Rewrite using CEL Interpolation</a></li></ul></li><li><a href="#action-result-variables" class="table-of-contents__link toc-highlight">Action Result Variables</a></li></ul></div></div></div></div></main></div></div></div><footer class="footer"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">ngrok Service</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/getting-started/">Get Started</a></li><li class="footer__item"><a href="https://dashboard.ngrok.com/signup" target="_blank" rel="noopener noreferrer" class="footer__link-item">Sign up</a></li><li class="footer__item"><a href="https://dashboard.ngrok.com/login" target="_blank" rel="noopener noreferrer" class="footer__link-item">Log in</a></li><li class="footer__item"><a href="https://download.ngrok.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Download</a></li><li class="footer__item"><a href="https://ngrok.com/docs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Docs</a></li><li class="footer__item"><a href="https://status.ngrok.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Status</a></li></ul></div><div class="col footer__col"><div class="footer__title">ngrok.com</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://ngrok.com/product" target="_blank" rel="noopener noreferrer" class="footer__link-item">Product</a></li><li class="footer__item"><a href="https://ngrok.com/pricing" target="_blank" rel="noopener noreferrer" class="footer__link-item">Pricing</a></li><li class="footer__item"><a href="https://ngrok.com/customers" target="_blank" rel="noopener noreferrer" class="footer__link-item">Customers</a></li><li class="footer__item"><a href="https://ngrok.com/solutions" target="_blank" rel="noopener noreferrer" class="footer__link-item">Solutions</a></li><li class="footer__item"><a href="https://ngrok.com/partners" target="_blank" rel="noopener noreferrer" class="footer__link-item">Partners</a></li><li class="footer__item"><a href="https://trust.ngrok.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Trust Portal</a></li></ul></div><div class="col footer__col"><div class="footer__title">Legal</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://ngrok.com/abuse" target="_blank" rel="noopener noreferrer" class="footer__link-item">Abuse</a></li><li class="footer__item"><a href="https://ngrok.com/dpa" target="_blank" rel="noopener noreferrer" class="footer__link-item">DPA</a></li><li class="footer__item"><a href="https://ngrok.com/privacy" target="_blank" rel="noopener noreferrer" class="footer__link-item">Privacy</a></li><li class="footer__item"><a href="https://ngrok.com/security" target="_blank" rel="noopener noreferrer" class="footer__link-item">Security</a></li><li class="footer__item"><a href="https://ngrok.com/tos" target="_blank" rel="noopener noreferrer" class="footer__link-item">Terms of service</a></li><li class="footer__item"><a href="https://ngrok.com/privacy-preferences" target="_blank" rel="noopener noreferrer" class="footer__link-item">Privacy Preferences</a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://ngrok.com/careers" target="_blank" rel="noopener noreferrer" class="footer__link-item">Careers</a></li><li class="footer__item"><a href="https://blog.ngrok.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">Blog</a></li><li class="footer__item"><a href="https://ngrok.com/slack" target="_blank" rel="noopener noreferrer" class="footer__link-item">Community</a></li><li class="footer__item"><a href="https://twitter.com/ngrokHQ" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter</a></li><li class="footer__item"><a href="https://www.linkedin.com/company/ngrok" target="_blank" rel="noopener noreferrer" class="footer__link-item">LinkedIn</a></li><li class="footer__item"><a href="https://github.com/ngrok" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">© ngrok 2024</div></div></div></footer></div> </body> </html>