[GH-ISSUE #460] Proxied URL not loading correct vhost from source server. #387

Closed
opened 2026-02-26 06:32:39 +03:00 by kerem · 3 comments
Owner

Originally created by @archness1 on GitHub (Jun 15, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/460

What is troubling you?

I have a Matomo site setup that I use to provide stats tracking across~10 other websites. I use proxied domains pointed at the same Matomo instance hosted on a cPanel server.

My setup is: Matomo installed at internal url of: http://webstats.example1.com
Externally it is: https://stats.example1.com. (This is proxied by NPM)
Then I have https://stats.example2.com, https://stats.example3.com

All of these are proxied to https://webstats.example1.com on the cPanel server.

When I load https://stats.example1.com, it loads a different vhost from the cPanel server. It should load https://webstats.example1.com. Instead it loads http://example6.com.

Is there an advanced config I need to add for nginx to proxy this correctly?

Originally created by @archness1 on GitHub (Jun 15, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/460 **What is troubling you?** I have a Matomo site setup that I use to provide stats tracking across~10 other websites. I use proxied domains pointed at the same Matomo instance hosted on a cPanel server. My setup is: Matomo installed at internal url of: http://webstats.example1.com Externally it is: https://stats.example1.com. (This is proxied by NPM) Then I have https://stats.example2.com, https://stats.example3.com All of these are proxied to https://webstats.example1.com on the cPanel server. When I load https://stats.example1.com, it loads a different vhost from the cPanel server. It should load https://webstats.example1.com. Instead it loads http://example6.com. Is there an advanced config I need to add for nginx to proxy this correctly?
kerem 2026-02-26 06:32:39 +03:00
Author
Owner

@theraw commented on GitHub (Jun 18, 2020):

https://github.com/jc21/nginx-proxy-manager/blob/master/docker/rootfs/etc/nginx/conf.d/include/proxy.conf#L2

to be able to reverse proxy stats.example1.com to webstats.example1.com you have to add
proxy_set_header Host webstats.example1.com;

but NPM does not have a feature to set custom HOST so this looks a bit not possible for now 🤒

<!-- gh-comment-id:646050754 --> @theraw commented on GitHub (Jun 18, 2020): https://github.com/jc21/nginx-proxy-manager/blob/master/docker/rootfs/etc/nginx/conf.d/include/proxy.conf#L2 to be able to reverse proxy `stats.example1.com` to `webstats.example1.com` you have to add proxy_set_header Host webstats.example1.com; but NPM does not have a feature to set custom HOST so this looks a bit not possible for now 🤒
Author
Owner

@archness1 commented on GitHub (Jun 18, 2020):

Thanks for taking a look at this. I had tried adding that into the advanced field yesterday but with no success.

Can we turn this ticket into an enhancement?

<!-- gh-comment-id:646119110 --> @archness1 commented on GitHub (Jun 18, 2020): Thanks for taking a look at this. I had tried adding that into the advanced field yesterday but with no success. Can we turn this ticket into an enhancement?
Author
Owner

@chaptergy commented on GitHub (May 12, 2021):

If this is an enhancement it would be a duplicate of https://github.com/jc21/nginx-proxy-manager/issues/127

<!-- gh-comment-id:839783767 --> @chaptergy commented on GitHub (May 12, 2021): If this is an enhancement it would be a duplicate of https://github.com/jc21/nginx-proxy-manager/issues/127
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#387
No description provided.