[PR #1258] [MERGED] Utilise variable for custom locations proxy_pass #3404

Closed
opened 2026-02-26 08:30:31 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/NginxProxyManager/nginx-proxy-manager/pull/1258
Author: @nightah
Created: 7/23/2021
Status: Merged
Merged: 8/7/2021
Merged by: @jc21

Base: developHead: fix-location-proxy_pass


📝 Commits (1)

  • 6c1ae77 Utilise variable for custom locations proxy_pass

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 backend/templates/_location.conf (+2 -1)

📄 Description

If a custom location is currently set to proxy to a DNS hostname this hostname is cached by nginx. When the underlying IP for the hostname changes this will be cached in nginx until it is restarted. This behaviour is somewhat undesirable if utilising containers.

This change sets the proxy_pass for custom locations into a variable and utilises said variable for routing to the upstream backend. This will ensure that nginx will utilise the resolver and resolve the hostname to the current IP instead of relying on the nginx cache.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/NginxProxyManager/nginx-proxy-manager/pull/1258 **Author:** [@nightah](https://github.com/nightah) **Created:** 7/23/2021 **Status:** ✅ Merged **Merged:** 8/7/2021 **Merged by:** [@jc21](https://github.com/jc21) **Base:** `develop` ← **Head:** `fix-location-proxy_pass` --- ### 📝 Commits (1) - [`6c1ae77`](https://github.com/NginxProxyManager/nginx-proxy-manager/commit/6c1ae77a2a40283c5444c2f7e0a7c8227aeecbd2) Utilise variable for custom locations proxy_pass ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/templates/_location.conf` (+2 -1) </details> ### 📄 Description If a custom location is currently set to proxy to a DNS hostname this hostname is cached by nginx. When the underlying IP for the hostname changes this will be cached in nginx until it is restarted. This behaviour is somewhat undesirable if utilising containers. This change sets the proxy_pass for custom locations into a variable and utilises said variable for routing to the upstream backend. This will ensure that nginx will utilise the resolver and resolve the hostname to the current IP instead of relying on the nginx cache. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 08:30:31 +03:00
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#3404
No description provided.