Rewrite HTTP responses in "reverse proxy" mode
tonio at ngyn.org
Tue Jul 5 16:52:21 MSD 2011
On 05/07/2011 14:19, Maxim Dounin wrote:
> 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.
> 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 as appropriate in your
> setup, by default it will only work on text/html.
>  http://sysoev.ru/nginx/docs/http/ngx_http_sub_module.html#sub_filter_types
> Maxim Dounin
> nginx mailing list
> nginx at nginx.org
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
More information about the nginx