[GH-ISSUE #652] Can I use sub_filter in proxy host advanced config? #554

Closed
opened 2026-02-26 06:33:22 +03:00 by kerem · 2 comments
Owner

Originally created by @rlogiacco on GitHub (Oct 14, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/652

Checklist

What is troubling you?
I'm trying to specify a sub_filter directive for a location within a proxy host, but it doesn't seem to work. By the nginx documentation, it seems the module must be enabled separately during Nginx build: is it enabled in your build?

Originally created by @rlogiacco on GitHub (Oct 14, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/652 **Checklist** - [x] Please read the [setup instructions](https://nginxproxymanager.com/setup/) - [x] Please read the [FAQ](https://nginxproxymanager.com/faq/) **What is troubling you?** I'm trying to specify a `sub_filter` directive for a location within a proxy host, but it doesn't seem to work. By the [nginx documentation](http://nginx.org/en/docs/http/ngx_http_sub_module.html), it seems the module must be enabled separately during Nginx build: is it enabled in your build?
kerem 2026-02-26 06:33:22 +03:00
Author
Owner

@rlogiacco commented on GitHub (Oct 15, 2020):

Looks like I found a solution: as I had another nginx in front of the proxy manager the communication between the two was gzipped, as such I must also add a directive to allow processing gzipped content.
The following advanced configuration works correctly:

proxy_set_header Accept-Encoding "";
sub_filter 'href="/' 'href="/admin/';
sub_filter 'src="/' 'src="/admin/';
sub_filter_once off;

Sadly I was trying to proxy the admin interface (/admin -> localhost:81), which seems not doable probably as a consequence of how the admin interface works in terms of HTML and node.js

<!-- gh-comment-id:709065616 --> @rlogiacco commented on GitHub (Oct 15, 2020): Looks like I found a solution: as I had another nginx in front of the proxy manager the communication between the two was gzipped, as such I must also add a directive to allow processing gzipped content. The following advanced configuration works correctly: ``` proxy_set_header Accept-Encoding ""; sub_filter 'href="/' 'href="/admin/'; sub_filter 'src="/' 'src="/admin/'; sub_filter_once off; ``` Sadly I was trying to proxy the admin interface (`/admin` -> `localhost:81`), which seems not doable probably as a consequence of how the admin interface works in terms of HTML and node.js
Author
Owner

@investlab commented on GitHub (Sep 16, 2021):

Same question!

<!-- gh-comment-id:920778008 --> @investlab commented on GitHub (Sep 16, 2021): Same question!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#554
No description provided.