# Info about original request URI in access phase

**URL:** <https://www.ruby-forum.com/t/info-about-original-request-uri-in-access-phase/245838>\
**Category:** NGINX\
**Created:** [July 19, 2013, 4:46pm UTC](https://www.ruby-forum.com/t/info-about-original-request-uri-in-access-phase/245838 "2013-07-19T16:46:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [July 19, 2013, 4:46pm UTC](https://www.ruby-forum.com/t/info-about-original-request-uri-in-access-phase/245838/1 "2013-07-19T16:46:29Z")

</div>

Hi,

I am writing a handler that checks a request signature during the access  
phase.

When there is URI rewriting, the URI the client used when signing does  
not match the URI the handler sees when checking the signature.

Question: How can I access the original request URI during the access  
phase?

Or would you rather suggest I hook the handler into the rewriting phase  
instead? Caveat here: when signature validation is successsful, the  
rwriting still needs to take place.

Can I control that by putting both handlers into the rewriting phase, in  
the correct order?

Jan

---

<div class="post-metadata">

**Author:** ![jandot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jandot](https://www.ruby-forum.com/u/jandot)\
**Post date:** [July 19, 2013, 6:32pm UTC](https://www.ruby-forum.com/t/info-about-original-request-uri-in-access-phase/245838/2 "2013-07-19T18:32:17Z")

</div>

On 19.07.2013, at 16:45, Jan A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,
> 
> I am writing a handler that checks a request signature during the access phase.
> 
> When there is URI rewriting, the URI the client used when signing does not match  
> the URI the handler sees when checking the signature.
> 
> Question: How can I access the original request URI during the access phase?

I found r-\>unparsed\_uri which seems to do the trick.

Jan
