# Re: trying to get something like proxypassreverse going

**URL:** <https://www.ruby-forum.com/t/re-trying-to-get-something-like-proxypassreverse-going/193682>\
**Category:** NGINX\
**Created:** [August 22, 2010, 4:58am UTC](https://www.ruby-forum.com/t/re-trying-to-get-something-like-proxypassreverse-going/193682 "2010-08-22T04:58:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![c1sc0](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e5b9ba/32.png) [@c1sc0](https://www.ruby-forum.com/u/c1sc0)\
**Post date:** [August 22, 2010, 4:58am UTC](https://www.ruby-forum.com/t/re-trying-to-get-something-like-proxypassreverse-going/193682/1 "2010-08-22T04:58:22Z")

</div>

Tim U. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

Hi there,

> > Arrange that the backend application generates the correct-for-you urls  
> > directly. That way, nginx doesn’t have to do any special processing of  
> > the body content, and it can just do what it does best.
> 
> Thanks Francis for that concise and extremely clear explanation of  
> what is going on. I now know where to go proceed.

You’re welcome.

There’s a fuller discussion of the issue – in the context of apache –  
at [Running a Reverse Proxy with Apache:](http://www.apachetutor.org/admin/reverseproxies#d8)

If you really really can’t adjust the backend application, then you’ll  
want something like apache’s mod\_proxy\_html (or mod\_substitute, or  
mod\_sed, but they will leave lots of the fiddly details up to you to  
get right).

nginx\_substitutions\_filter at [http://wiki.nginx.org/NginxHttpSubsModule](http://wiki.nginx.org/NginxHttpSubsModule)  
looks like the closest starting point to me; but you pretty much have to  
parse the html and css to find things that end browser will consider a  
url, and change all of them and only them. Parsing with regexes isn’t  
fun.

Possibly someone has already done the work of creating an nginx version  
of mod\_proxy\_html and then put it somewhere hidden from $SEARCH\_ENGINE;  
more likely everyone just configures the backend application to avoid  
the need to adjust.

All the best,

## f

Francis D. removed\_email\_address@domain.invalid
