determining the url of a request

Jeff Kaufman jefftk at google.com
Tue Oct 16 19:02:11 UTC 2012


If I have a ngx_http_request_t, is there a built-in way to get the
full url for the request? r->uri has "/path/to/page.html" but is there
a way to get a full "scheme://host[:port]/path/to/page.html"?

Some background: I'm working on ngx_pagespeed [1], a port of
mod_pagespeed to nginx.  The idea is to automatically rewrite webpages
and their resources to make pages load faster.  The pagespeed code
needs to know what url has been requested so it can do things like
turn absolute urls into relative urls.

Jeff

[1] https://github.com/pagespeed/ngx_pagespeed



More information about the nginx-devel mailing list