iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
A slash at the end of proxy_pass matters when it makes the directive include a URI. With a URI, Nginx replaces the part of the normalized request URI that matches the location prefix. Without a URI, it follows a different pass-through rule. A slash at the end of a location prefix is a separate case: it can trigger a redirect when a request omits that slash.
What a URI in proxy_pass changes
Nginx’s proxy module documentation says that when proxy_pass specifies a URI, Nginx replaces the portion of the normalized request URI matching the location with the URI in the directive.
location /name/ {
proxy_pass http://127.0.0.1/remote/;
}
For an incoming path of /name/item, the matching /name/ prefix is replaced with /remote/, so the upstream path is /remote/item. The two trailing slashes shown here are parts of the location prefix and proxy URI respectively; the replacement rule explains how they combine.
This rule concerns the normalized request URI, not raw character-by-character editing of the request target.
#1 Best Overall
What changes when proxy_pass has no URI
When the directive ends at the upstream address, there is no URI to replace the matched location prefix. Nginx documents a different behavior: for an original request, it passes the request URI in its original form; if processing has changed the URI, it passes the full normalized URI.
location /some/path/ {
proxy_pass http://127.0.0.1;
}
Here, the absence of a slash or other URI after 127.0.0.1 is significant. Do not read this form as if it supplied / and replaced /some/path/.
Rank #2
Do not confuse the location slash with the proxy URI
Nginx’s core module documentation describes a separate rule for slash-terminated prefix locations. When such a location is handled by proxy_pass (or certain other pass directives), a request whose URI exactly matches the location string but lacks its final slash receives a permanent 301 redirect with the slash appended.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
For example, a request for /name can be redirected to /name/ when the relevant location is location /name/. This is request handling at the location boundary; it is not the prefix-replacement rule for a URI-bearing proxy_pass.
Rank #3
Work out the upstream path
-
Write down the incoming request path and identify which
locationmatches it. -
Check whether
proxy_passcontains a URI after the upstream address. A URI-bearing form invokes the replacement rule; a form with only the upstream address follows the no-URI behavior. -
If there is a URI, replace the portion of the normalized request URI that matches the location with the URI from
proxy_pass. Keep the unmatched remainder of the path.Free tools Windows power users keep installed
One-click scans. No signup required.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Check separately whether the request exactly matches a slash-terminated prefix location while omitting its final slash. That can produce the documented
301redirect before the upstream-path question arises.
Cases that need separate handling
Regex and named locations
For regex and named locations, Nginx says it cannot determine the portion of the URI to replace. Use proxy_pass without a URI in these locations, as described in the proxy module documentation.
A rewrite followed by break
If a rewrite changes the URI in a proxied location and processing continues in that configuration using break, Nginx ignores the URI in proxy_pass and passes the full changed request URI upstream.
Variables in proxy_pass
Variable-based proxy_pass has different URI handling: if a URI is specified, it is passed as-is and replaces the original request URI. Do not assume the ordinary location-prefix example applies unchanged; check the exact directive and how its variables are constructed.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Check the documentation for your Nginx version
The official Nginx documentation pages linked here were checked on October 7, 2026. Because behavior can be version-specific, consult the documentation corresponding to the Nginx release you run when validating a configuration.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

