Question about proxy

Francis Daly francis at
Tue Jan 31 01:20:29 UTC 2023

On Sun, Jan 29, 2023 at 03:17:15PM -0500, Saint Michael wrote:

Hi there,

> What causes each case, i.e., what do I need to do so always the
> is NOT the original domain being proxied, but my
> own domain (

You seem to be using the module at

You probably want subs_filter_types to include text/html, and you probably
want "r" on the subs_filter patterns that are regular expressions rather
than fixed strings.

Generally, you proxy_pass to a server you control, so it may be easier
to adjust the upstream so that subs_filter is not needed. But basically:
you want any string in the response that the browser will interpret as
a url, to be on your server not on the upstream one.

So in this case, you can test the output of things like "curl -i", and see that it does not contain any
unexpected mention of

> subs_filter_types text/css text/javascript application/javascript;
> subs_filter "https://cdn**)"
> "*/$1" gi
> subs_filter "*)" "$1" gi;
> subs_filter "https://(.*)*)" "$1/$2" gi;
> subs_filter "" "" gi;
> subs_filter "" "" gi;
> subs_filter "" "" gi;

If you do see an unexpected mention, you can try to see why it is there
-- especially the first subs_filter above, I'm not certain what it
is trying to do; and the second one probably does not need the regex
parts at all -- the fifth and sixth ones probably both do the same
thing as it. The third and fourth seem to have different ideas of how
"" should be substituted; maybe you
have a test case which shows why both are needed.

Good luck with it,

Francis Daly        francis at

More information about the nginx mailing list