[GH-ISSUE #472] Pass the request to another reverse proxy server #398

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

Originally created by @geek-baba on GitHub (Jun 23, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/472

This is working great for most use cases I have except when I am trying to redirect to another proxy service running on my Kubernetes cluster. The K8s cluster is running nginx ingress (proxy) and it should route to specific app based on the domain name. However looks like when I am passing it via nginx proxy manager to my k8s cluster, the url/domain name is not passed to it.

So in simplest terms I want to pass domain name from one nginx server to another for further processing, is this something possible?

Originally created by @geek-baba on GitHub (Jun 23, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/472 This is working great for most use cases I have except when I am trying to redirect to another proxy service running on my Kubernetes cluster. The K8s cluster is running nginx ingress (proxy) and it should route to specific app based on the domain name. However looks like when I am passing it via nginx proxy manager to my k8s cluster, the url/domain name is not passed to it. So in simplest terms I want to pass domain name from one nginx server to another for further processing, is this something possible?
kerem 2026-02-26 06:32:42 +03:00
Author
Owner

@pantherale0 commented on GitHub (Jun 25, 2020):

Try setting these in the advanced config:

    proxy_set_header Host            $host;
    proxy_set_header X-Forwarded-For $remote_addr;
<!-- gh-comment-id:649384845 --> @pantherale0 commented on GitHub (Jun 25, 2020): Try setting these in the advanced config: ``` proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; ```
Author
Owner

@geek-baba commented on GitHub (Jun 26, 2020):

It does not work, also it says on advance config page:

Nginx variables available to you are:

$server # Host/IP
$port # Port Number
$forward_scheme # http or https
<!-- gh-comment-id:650151958 --> @geek-baba commented on GitHub (Jun 26, 2020): It does not work, also it says on advance config page: ``` Nginx variables available to you are: $server # Host/IP $port # Port Number $forward_scheme # http or https ```
Author
Owner

@saschamander commented on GitHub (May 7, 2021):

@geek-baba Did you find any solutions for this?

I'm currently struggling to achieve the almost the same.
(For my case there is no kubernetes involved.)

Also found this issue https://github.com/jc21/nginx-proxy-manager/issues/286 which seems to cover the same topic.

<!-- gh-comment-id:834714006 --> @saschamander commented on GitHub (May 7, 2021): @geek-baba Did you find any solutions for this? I'm currently struggling to achieve the almost the same. (For my case there is no kubernetes involved.) Also found this issue https://github.com/jc21/nginx-proxy-manager/issues/286 which seems to cover the same topic.
Author
Owner

@geek-baba commented on GitHub (May 21, 2021):

I had to separate the this proxy and k8s cluster to point to 2 different static IP's

<!-- gh-comment-id:845895703 --> @geek-baba commented on GitHub (May 21, 2021): I had to separate the this proxy and k8s cluster to point to 2 different static IP's
Author
Owner

@jhs512 commented on GitHub (Feb 9, 2023):

i solved this problem by this way : https://stackoverflow.com/questions/37523615/dynamic-proxy-pass-in-nginx-to-another-pod-in-kubernetes

After much research and trial and error I managed to solve this. First I changed the pod specification to:

spec:
containers:
- name: nginx
image: "nginx:1.10.0"
ports:
- containerPort: 8080
name: "external"
protocol: "TCP"
- name: dnsmasq
image: "janeczku/go-dnsmasq:release-1.0.5"
args:
- --listen
- "127.0.0.1:53"
- --default-resolver
- --append-search-domains
- --hostsfile=/etc/hosts
- --verbose
then I also had to disable the ipv6 for the resolver in nginx:

location ~ ^/(.+)$ {
resolver 127.0.0.1:53 ipv6=off;
set $backend "http://$1:80";
proxy_pass $backend;
}
Then it works as expected!

<!-- gh-comment-id:1424589984 --> @jhs512 commented on GitHub (Feb 9, 2023): i solved this problem by this way : https://stackoverflow.com/questions/37523615/dynamic-proxy-pass-in-nginx-to-another-pod-in-kubernetes After much research and trial and error I managed to solve this. First I changed the pod specification to: spec: containers: - name: nginx image: "nginx:1.10.0" ports: - containerPort: 8080 name: "external" protocol: "TCP" - name: dnsmasq image: "janeczku/go-dnsmasq:release-1.0.5" args: - --listen - "127.0.0.1:53" - --default-resolver - --append-search-domains - --hostsfile=/etc/hosts - --verbose then I also had to disable the ipv6 for the resolver in nginx: location ~ ^/(.+)$ { resolver 127.0.0.1:53 ipv6=off; set $backend "http://$1:80"; proxy_pass $backend; } Then it works as expected!
Author
Owner

@github-actions[bot] commented on GitHub (Mar 28, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2024254459 --> @github-actions[bot] commented on GitHub (Mar 28, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (May 8, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2861263127 --> @github-actions[bot] commented on GitHub (May 8, 2025): Issue was closed due to inactivity.
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#398
No description provided.