Welcome! Log In Create A New Profile

Advanced

sub_filter unable to replace string in iframes

Posted by gundaldo 
sub_filter unable to replace string in iframes
September 18, 2024 01:26AM
Hi Everyone,

I'm testing Nginx as revrproxy for one of the application. One of the requirement is to replace the domain string. I was able to achieve this using sub_filter_types but the Iframes from the page still contains actual domain where our application is running.

Example:
Users will be using abc.com but actual application is running on xyz.com. When users hit abc.com the login and rest of the stuff works as expected but iframes still showing xyz.com.

Nginx Config:

server {
listen [::]:10000 ssl;
server_name abc.com;
root /usr/share/nginx/html;

proxy_redirect https://xyz.com/ $scheme://abc.com/;

sub_filter_types *;
sub_filter xyz.com abc.com;
sub_filter_once off;

location / {
proxy_pass https://xyz.com;
proxy_set_header Host xyz.com;
}
}

I have tried without "sub_filter_types *;" but issue still exist. Does iframes part of sub_filter_types? How can I address this?

Any help is appreciated. Thanks
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 270
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready