mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-12-02 18:31:23 +01:00
Merge pull request #5741 from addielaruee/fix/stream-ipv6-forward-host-brackets
fix(stream): bracket IPv6 forward host for valid nginx upstream
This commit is contained in:
1 file changed
+9
@@ -1,4 +1,5 @@
|
|||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
|
import net from "node:net";
|
||||||
import { dirname } from "node:path";
|
import { dirname } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
@@ -226,6 +227,14 @@ const internalNginx = {
|
|||||||
host.forward_scheme = "$scheme";
|
host.forward_scheme = "$scheme";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A stream forwarding to an IPv6 literal must have the address wrapped in
|
||||||
|
// square brackets before nginx appends ":<port>". Without the brackets nginx
|
||||||
|
// reads the trailing ":<port>" as part of the address and rejects the upstream
|
||||||
|
// ("invalid port in upstream"), so the stream saves but never activates (#5740).
|
||||||
|
if (nice_host_type === "stream" && net.isIPv6(host.forwarding_host)) {
|
||||||
|
host.forwarding_host = `[${host.forwarding_host}]`;
|
||||||
|
}
|
||||||
|
|
||||||
if (host.locations) {
|
if (host.locations) {
|
||||||
//logger.info ('host.locations = ' + JSON.stringify(host.locations, null, 2));
|
//logger.info ('host.locations = ' + JSON.stringify(host.locations, null, 2));
|
||||||
origLocations = [].concat(host.locations);
|
origLocations = [].concat(host.locations);
|
||||||
|
|||||||
Reference in new issue
Block a user