Home Nginx proxy/sub_filter css output not being changed
Reply: 0

Nginx proxy/sub_filter css output not being changed

Adrian
1#
Adrian Published in 2017-12-06 07:06:05Z

I'm currently setting up a reverse proxy using nginx which for the most part is working perfectly.

The conf file has the following entry:

server {
    listen proxy.com default_server;

location  /example.com/ {
proxy_set_header Accept-Encoding "";
proxy_set_header Host example.com;
proxy_pass https://1.2.3.4/;
sub_filter_types text/html text/css text/javascript;
sub_filter "http://example.com/" "http://proxy.com/example.com/";
sub_filter_once off;
}
}

The proxy is successfully sending back the page and serving elements from the correct proxy locations, however this is where the problem begins.

The style-sheet (http://proxy.com/example.com/css/style.css) loads perfectly through the proxy, but inside that, there is a style import line as follows:

@import "http://example.com/css/fonts/entypo.css";

As you can see, the domain is not being filterd/changed by the sub_filter at all inside the CSS file.

I have tried changing sub_filter types to the following with no luck:

sub_filter_types *;

Should the filter be changing the domain in the CSS file?

If so, is there something I am doing wrong?

Thank you in advance!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.304872 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO