Welcome! Log In Create A New Profile

Advanced

sub_filter (CSS,JS)

Adrian Acosta
April 12, 2018 02:56AM
Hi Everyone!

We're using nginx as a reverse proxy for a staging system so customers can
view the contents of their directories without a resolving domain.

It's working really well, but the issue is, references to their domain
aren't being filtered inside their CSS or JS files which are also loading
via the proxy URL.

*Currently the configuration of each host is as follows. *

server {
server_name example-com-au.tempexample.com.au;
location / {
proxy_set_header Host real-domain.com;
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
proxy_pass http://ip.ip.ip.ip/;
sub_filter_types text/html text/css text/javascript;
proxy_set_header Accept-Encoding "*";
sub_filter "http://real-domain.com/" "
http://example-com-au.tempexample.com.au/";
sub_filter_once off;
}
}


Does anybody know if we can further configure a sub_filter so that the
contents of JS and CSS files are also filtered when loaded via the proxy?

It has been very hard finding relevant information, the docs aren't overly
helpful and even stackoverflow hasn't wielded good results.

Thanks in advance!
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

sub_filter (CSS,JS)

Adrian Acosta April 12, 2018 02:56AM

RE: sub_filter (CSS,JS)

Reinis Rozitis April 12, 2018 03:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 300
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