Beginner question:Nginx request_uri meaning ?
Bike dernikov1
dernikov1 at gmail.com
Thu Jan 12 08:43:35 UTC 2017
Hi,
Thanks for answer and detail explanation.
So to conclude and confirm that i undestand completly.
If client request
http://www.example.com/index.html
return 301 $scheme://example1.com$request_uri;
mean: return 301 http://example1.com/index.html.
Thanks again for big help. I wold never found explanation myself.
On Wed, Jan 11, 2017 at 6:28 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> Hello!
>
> On Wed, Jan 11, 2017 at 05:18:26PM +0100, Bike dernikov1 wrote:
>
> > Hi, i have "simple" question, need simple explanation. It's driving me
> > nuts.
> >
> > In nginx configuration what is meaning of $request_uri in line?
> >
> > *********************************************************
> > return 301 $scheme://example.com1$request_uri;
> > ***********************************************************
> > In documentation write: $request_uri is full request URI.
> > I will try to describe my doubth.
> >
> > Simple request URL: http://www.example.com/index.html
> >
> > Full request URI is the same: http://example.com/index.html
> >
> > $request_uri=http://example.com/index.html.
> >
> > As i understand then line:
> >
> > return 301 $scheme://example1.com$request_uri;
> >
> > must return:
> >
> > http://example1.comhttp://example.com/index.html.
> >
> > But that cannot be correct.
> >
> > So what mean var $request_uri ? Is defined wrong in documentation. (or
> URI
> > is not what i described ?) or it mean something different, or it mean
> > something different in combination with return ??
> > Thanks for help.
>
> The term "request URI" as used in the nginx documentation in many
> places, as well as in various variables, dates back to the
> original and most common HTTP meaning - the URI form as used
> identify a resource on a server.
>
> Quoting https://tools.ietf.org/html/rfc1945#section-5.1.2:
>
> The most common form of Request-URI is that used to identify a
> resource on an origin server or gateway. In this case, only the
> absolute path of the URI is transmitted (see Section 3.2.1,
> abs_path). For example, a client wishing to retrieve the resource
> above directly from the origin server would create a TCP connection
> to port 80 of the host "www.w3.org" and send the line:
>
> GET /pub/WWW/TheProject.html HTTP/1.0
>
> followed by the remainder of the Full-Request. Note that the absolute
> path cannot be empty; if none is present in the original URI, it must
> be given as "/" (the server root).
>
> At the HTTP/1.0 time this was the only allowed form in requests to
> origin servers (absolute form was only allowed in requests to a
> proxy).
>
> With HTTP/1.1 absolute form can be also used in normal
> requests, but it's not something actually used in practice, and
> also not something various configurations and software can cope
> with. So even if a request uses the absolute form of the request
> URI, nginx provides $request_uri as if it was given in the
> abs_path form.
>
> --
> Maxim Dounin
> http://nginx.org/
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170112/fe20df1c/attachment.html>
More information about the nginx
mailing list