mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-19 10:36:26 +00:00
Add support for proxy_protocol in proxy_hosts and streams
Closes #1114 Related To #1882 Related To #3537 Related To #3618 Co-authored-by: jwklijnsma <janwiebe@janwiebe.eu> Co-authored-by: SBado <16034687+SBado@users.noreply.github.com>
This commit is contained in:
@ -72,7 +72,7 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="custom-switch">
|
||||
<input type="checkbox" class="custom-switch-input" name="allow_websocket_upgrade" value="1"<%- allow_websocket_upgrade ? ' checked' : '' %>>
|
||||
@ -81,6 +81,24 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="custom-switch">
|
||||
<input type="checkbox" class="custom-switch-input" name="proxy_protocol_enabled" value="1"<%- proxy_protocol_enabled ? ' checked' : '' %>>
|
||||
|
||||
|
||||
<span class="custom-switch-indicator"></span>
|
||||
<span class="custom-switch-description"><%- i18n('proxy-hosts', 'enable-proxy-protocol') %><a href="https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol/#introduction" target="_blank"><i class="fe fe-help-circle"></i></a></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label"><%- i18n('proxy-hosts', 'load-balancer-ip') %> <a href="https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol/#changing-the-load-balancers-ip-address-to-the-client-ip-address" target="_blank"><i class="fe fe-help-circle"></i></a></label>
|
||||
<input type="text" name="loadbalancer_address" class="form-control text-monospace" placeholder="" value="<%- loadbalancer_address %>" autocomplete="off" maxlength="255" <%- proxy_protocol_enabled ? '' : ' disabled' %>>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
|
@ -43,7 +43,9 @@ module.exports = Mn.View.extend({
|
||||
dns_provider_credentials: 'textarea[name="meta[dns_provider_credentials]"]',
|
||||
propagation_seconds: 'input[name="meta[propagation_seconds]"]',
|
||||
forward_scheme: 'select[name="forward_scheme"]',
|
||||
letsencrypt: '.letsencrypt'
|
||||
letsencrypt: '.letsencrypt',
|
||||
proxy_protocol_enabled: 'input[name="proxy_protocol_enabled"]',
|
||||
loadbalancer_address: 'input[name="loadbalancer_address"]',
|
||||
},
|
||||
|
||||
regions: {
|
||||
@ -101,6 +103,14 @@ module.exports = Mn.View.extend({
|
||||
}
|
||||
},
|
||||
|
||||
'change @ui.proxy_protocol_enabled': function () {
|
||||
let checked = this.ui.proxy_protocol_enabled.prop('checked');
|
||||
this.ui.loadbalancer_address
|
||||
.prop('disabled', !checked)
|
||||
.parents('.form-group')
|
||||
.css('opacity', checked ? 1 : 0.5);
|
||||
},
|
||||
|
||||
'change @ui.dns_challenge_switch': function () {
|
||||
const checked = this.ui.dns_challenge_switch.prop('checked');
|
||||
if (checked) {
|
||||
@ -167,6 +177,7 @@ module.exports = Mn.View.extend({
|
||||
data.hsts_enabled = !!data.hsts_enabled;
|
||||
data.hsts_subdomains = !!data.hsts_subdomains;
|
||||
data.ssl_forced = !!data.ssl_forced;
|
||||
data.proxy_protocol_enabled = !!data.proxy_protocol_enabled;
|
||||
|
||||
if (typeof data.meta === 'undefined') data.meta = {};
|
||||
data.meta.letsencrypt_agree = data.meta.letsencrypt_agree == 1;
|
||||
@ -266,6 +277,7 @@ module.exports = Mn.View.extend({
|
||||
|
||||
this.ui.ssl_forced.trigger('change');
|
||||
this.ui.hsts_enabled.trigger('change');
|
||||
this.ui.proxy_protocol_enabled.trigger('change');
|
||||
|
||||
// Domain names
|
||||
this.ui.domain_names.selectize({
|
||||
|
Reference in New Issue
Block a user