Rewrite HTTP responses in "reverse proxy" mode

Antoine Nguyen tonio at
Tue Jul 5 16:52:21 MSD 2011

On 05/07/2011 14:19, Maxim Dounin wrote:
> Hello!
> On Tue, Jul 05, 2011 at 01:01:31PM +0200, Antoine Nguyen wrote:
>> Hi all,
>> I'm trying to create a reverse proxy to serve a moodle site hosted
>> in the LAN of my company. The site is available from the Internet
>> but all links to static content in the HTTP responses are using the
>> internal address. This is an issue with moodle, not with nginx.
>> Because I don't want to loose too much time on this, I'm trying to
>> play with both sub and subs modules to rewrite all occurences of
>> "internal address" to "external address" but without success.
>> I'm wondering if HTTP substition is intented to work in a reverse
>> proxy context.
> Yes.
> Please note though that response must not be compressed by
> backend, i.e. you may want to add something like
>      proxy_set_header Accept-Encoding "";
> to nginx config.
> You may also need to set sub_filter_types[1] as appropriate in your
> setup, by default it will only work on text/html.
> [1]
> Maxim Dounin
> _______________________________________________
> nginx mailing list
> nginx at
I've just found what was the problem before reading your answer : the 
backend had "mod_deflate" enabled by default. It works well now.

By the way, many thanks for your answer Maxim, it was exactly what I 
needed :-)

Antoine Nguyen
Modoboa developer

More information about the nginx mailing list