mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-04-26 17:12:27 +00:00
allow domain like 'com.example.com:8080',use external port and nginx programmer manager listen thses ports
This commit is contained in:
parent
fd30cfe98b
commit
f00fe275ca
@ -32,6 +32,16 @@ const internalNginx = {
|
||||
return internalNginx.deleteConfig(host_type, host); // Don't throw errors, as the file may not exist at all
|
||||
})
|
||||
.then(() => {
|
||||
boolean use_default_port = false;
|
||||
let listen_ports = [];
|
||||
_.each(host.domain_names, (domain_name) => {
|
||||
if ( domain_name.indexOf(":") < 0 ){
|
||||
host.use_default_port = true;
|
||||
}else{
|
||||
let listen_port = parseInt(domain_name.substring(domain_name.indexOf(":")+1));
|
||||
}
|
||||
});
|
||||
|
||||
return internalNginx.generateConfig(host_type, host);
|
||||
})
|
||||
.then(() => {
|
||||
|
@ -12,4 +12,7 @@
|
||||
#listen [::]:443;
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% for listen_port in listen_ports %}
|
||||
listen listen_port;
|
||||
{% endfor %}
|
||||
server_name {{ domain_names | join: " " }};
|
||||
|
@ -56,6 +56,7 @@ proxy_http_version 1.1;
|
||||
{% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $http_connection;
|
||||
proxy_set_header Host $host:$server_port;
|
||||
proxy_http_version 1.1;
|
||||
{% endif %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user