# Using proxy\_redirect correctly

**URL:** <https://www.ruby-forum.com/t/using-proxy-redirect-correctly/244619>\
**Category:** NGINX\
**Created:** [May 13, 2016, 5:32pm UTC](https://www.ruby-forum.com/t/using-proxy-redirect-correctly/244619 "2016-05-13T17:32:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [May 13, 2016, 5:32pm UTC](https://www.ruby-forum.com/t/using-proxy-redirect-correctly/244619/1 "2016-05-13T17:32:59Z")

</div>

Hi all,  
My proxy seems to be working, at least so far. I browse to  
[sd2.mysite.com](http://sd2.mysite.com)  
and find the OSTicket installer. Since I’ve removed the OST site from  
Nginx, I know Apache is kicking it like it should be. The only problem  
now  
is that OST thinks its location is 127.0.0.1:8080, which is the internal  
redirection but not what I want it to use.

I know I have to use proxy\_redirect, but I don’t quite understand how  
this  
directive works. I just tried:  
proxy\_redirect 127.0.0.1:8080 [sd2.mysite.com](http://sd2.mysite.com);  
but that didn’t work. I find the documentation I’ve read thus far to be  
rather confusing. All I want to do is replace 127.0.0.1:8080 in any URL  
on  
this site with [sd2.mysite.com](http://sd2.mysite.com). Do I need some kind of regular  
expression?  
To move this proxy somewhere else (currently it’s in location /  
context)?  
Should my proxy\_pass also be moved to a different context?
