Forum: NGINX proxy_pass and sub_filter?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Yuxing H. (Guest)
on 2009-02-16 21:54
Hi, I have a special use case to employ sub_filter to alter the content
from an upstream server by proxy_pass. Here is my minimal nginx.conf:

#############

user www-data www-data;

worker_processes 4;

events
{
        use epoll;
        worker_connections 2048;
}

http
{
        include "mime.types";
        server
        {
                server_name  external.upei.ca;

                listen 80;

                sub_filter internal.upei.ca external.upei.ca;
                sub_filter_types text/xml text/css text/javascript;

                location /
                {
                        proxy_pass http://internal.upei.ca;
                }
        }
}

#########

But the substitution filter does not work in this configuration. I tried
fastcgi_pass before and sub_filter works with fastcgi_pass. I also
googled around and found no answer to this question. Is this
configuration correct for sub_filter the content from a proxy upstream
server? Thank you!
Yuxing H. (Guest)
on 2009-02-17 01:07
I figured out that my backend server is configured with gzip module.
When I disable the gzip module, it works perfectly.
This topic is locked and can not be replied to.