Welcome! Log In Create A New Profile

Advanced

Nginx replacing body content

Duane Mulder
October 18, 2010 06:24PM
Hello all:

So I have been using nginx for a while now for various types of proxying
and SSL acceleration all with great success. However now I need to
replace specific content within an html body. I have been trying to get
the HttpSubsModule to work as It appears to do what I am looking for.
However I have not been able to get it to match or replace any content
whatsover. I believe I have the module compiled and loading.

Here is a snippit of my config, my goal would be to replace all
instances of 'cat' with the word dog.

server { #server80
listen 80;
server_name community.qnx.com;
access_log /var/log/nginx/proxy.access.log;
##error_log /var/log/nginx/proxy.error.log debug;



location / {
subs_filter_types text/html;
subs_filter cat dog i;


#proxy_set_header X-Forwarded-Host $host;
#proxy_set_header X-Forwarded-Server $host;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://internal.site.com:80/;
#proxy_redirect off;
}

} #server80


Regards.
Duane



_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx replacing body content

Duane Mulder October 18, 2010 06:24PM

Re: Nginx replacing body content

Weibin Yao October 18, 2010 10:08PM

Re: Nginx replacing body content

Duane Mulder October 19, 2010 12:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 233
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready