mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
Host or IP specified for Proxy Host Forward
This commit is contained in:
parent
0b8a49469f
commit
dba4340548
@ -354,7 +354,7 @@ module.exports = function () {
|
|||||||
.insertAndFetch({
|
.insertAndFetch({
|
||||||
owner_user_id: 1,
|
owner_user_id: 1,
|
||||||
domain_names: [host.hostname],
|
domain_names: [host.hostname],
|
||||||
forward_ip: host.forward_server,
|
forward_host: host.forward_server,
|
||||||
forward_port: host.forward_port,
|
forward_port: host.forward_port,
|
||||||
access_list_id: access_list_id,
|
access_list_id: access_list_id,
|
||||||
certificate_id: certificate_id,
|
certificate_id: certificate_id,
|
||||||
|
36
src/backend/migrations/20181019052346_forward_host.js
Normal file
36
src/backend/migrations/20181019052346_forward_host.js
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const migrate_name = 'forward_host';
|
||||||
|
const logger = require('../logger').migrate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migrate
|
||||||
|
*
|
||||||
|
* @see http://knexjs.org/#Schema
|
||||||
|
*
|
||||||
|
* @param {Object} knex
|
||||||
|
* @param {Promise} Promise
|
||||||
|
* @returns {Promise}
|
||||||
|
*/
|
||||||
|
exports.up = function (knex/*, Promise*/) {
|
||||||
|
logger.info('[' + migrate_name + '] Migrating Up...');
|
||||||
|
|
||||||
|
return knex.schema.table('proxy_host', function (proxy_host) {
|
||||||
|
proxy_host.renameColumn('forward_ip', 'forward_host');
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
logger.info('[' + migrate_name + '] proxy_host Table altered');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Undo Migrate
|
||||||
|
*
|
||||||
|
* @param {Object} knex
|
||||||
|
* @param {Promise} Promise
|
||||||
|
* @returns {Promise}
|
||||||
|
*/
|
||||||
|
exports.down = function (knex, Promise) {
|
||||||
|
logger.warn('[' + migrate_name + '] You can\'t migrate down this one.');
|
||||||
|
return Promise.resolve(true);
|
||||||
|
};
|
@ -18,9 +18,10 @@
|
|||||||
"domain_names": {
|
"domain_names": {
|
||||||
"$ref": "../definitions.json#/definitions/domain_names"
|
"$ref": "../definitions.json#/definitions/domain_names"
|
||||||
},
|
},
|
||||||
"forward_ip": {
|
"forward_host": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "ipv4"
|
"minLength": 1,
|
||||||
|
"maxLength": 50
|
||||||
},
|
},
|
||||||
"forward_port": {
|
"forward_port": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@ -67,8 +68,8 @@
|
|||||||
"domain_names": {
|
"domain_names": {
|
||||||
"$ref": "#/definitions/domain_names"
|
"$ref": "#/definitions/domain_names"
|
||||||
},
|
},
|
||||||
"forward_ip": {
|
"forward_host": {
|
||||||
"$ref": "#/definitions/forward_ip"
|
"$ref": "#/definitions/forward_host"
|
||||||
},
|
},
|
||||||
"forward_port": {
|
"forward_port": {
|
||||||
"$ref": "#/definitions/forward_port"
|
"$ref": "#/definitions/forward_port"
|
||||||
@ -131,15 +132,15 @@
|
|||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": [
|
"required": [
|
||||||
"domain_names",
|
"domain_names",
|
||||||
"forward_ip",
|
"forward_host",
|
||||||
"forward_port"
|
"forward_port"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"domain_names": {
|
"domain_names": {
|
||||||
"$ref": "#/definitions/domain_names"
|
"$ref": "#/definitions/domain_names"
|
||||||
},
|
},
|
||||||
"forward_ip": {
|
"forward_host": {
|
||||||
"$ref": "#/definitions/forward_ip"
|
"$ref": "#/definitions/forward_host"
|
||||||
},
|
},
|
||||||
"forward_port": {
|
"forward_port": {
|
||||||
"$ref": "#/definitions/forward_port"
|
"$ref": "#/definitions/forward_port"
|
||||||
@ -193,8 +194,8 @@
|
|||||||
"domain_names": {
|
"domain_names": {
|
||||||
"$ref": "#/definitions/domain_names"
|
"$ref": "#/definitions/domain_names"
|
||||||
},
|
},
|
||||||
"forward_ip": {
|
"forward_host": {
|
||||||
"$ref": "#/definitions/forward_ip"
|
"$ref": "#/definitions/forward_host"
|
||||||
},
|
},
|
||||||
"forward_port": {
|
"forward_port": {
|
||||||
"$ref": "#/definitions/forward_port"
|
"$ref": "#/definitions/forward_port"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% include "_header_comment.conf" %}
|
{% include "_header_comment.conf" %}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
set $server {{ forward_ip }};
|
set $server "{{ forward_host }}";
|
||||||
set $port {{ forward_port }};
|
set $port {{ forward_port }};
|
||||||
|
|
||||||
{% include "_listen.conf" %}
|
{% include "_listen.conf" %}
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-sm-8 col-md-8">
|
<div class="col-sm-8 col-md-8">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label"><%- i18n('proxy-hosts', 'forward-ip') %><span class="form-required">*</span></label>
|
<label class="form-label"><%- i18n('proxy-hosts', 'forward-host') %><span class="form-required">*</span></label>
|
||||||
<input type="text" name="forward_ip" class="form-control text-monospace" placeholder="000.000.000.000" value="<%- forward_ip %>" autocomplete="off" maxlength="15" required>
|
<input type="text" name="forward_host" class="form-control text-monospace" placeholder="" value="<%- forward_host %>" autocomplete="off" maxlength="50" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4 col-md-4">
|
<div class="col-sm-4 col-md-4">
|
||||||
|
@ -9,7 +9,6 @@ const accessListItemTemplate = require('./access-list-item.ejs');
|
|||||||
const Helpers = require('../../../lib/helpers');
|
const Helpers = require('../../../lib/helpers');
|
||||||
|
|
||||||
require('jquery-serializejson');
|
require('jquery-serializejson');
|
||||||
require('jquery-mask-plugin');
|
|
||||||
require('selectize');
|
require('selectize');
|
||||||
|
|
||||||
module.exports = Mn.View.extend({
|
module.exports = Mn.View.extend({
|
||||||
@ -19,7 +18,7 @@ module.exports = Mn.View.extend({
|
|||||||
ui: {
|
ui: {
|
||||||
form: 'form',
|
form: 'form',
|
||||||
domain_names: 'input[name="domain_names"]',
|
domain_names: 'input[name="domain_names"]',
|
||||||
forward_ip: 'input[name="forward_ip"]',
|
forward_host: 'input[name="forward_host"]',
|
||||||
buttons: '.modal-footer button',
|
buttons: '.modal-footer button',
|
||||||
cancel: 'button.cancel',
|
cancel: 'button.cancel',
|
||||||
save: 'button.save',
|
save: 'button.save',
|
||||||
@ -123,12 +122,6 @@ module.exports = Mn.View.extend({
|
|||||||
onRender: function () {
|
onRender: function () {
|
||||||
let view = this;
|
let view = this;
|
||||||
|
|
||||||
// IP Address
|
|
||||||
this.ui.forward_ip.mask('099.099.099.099', {
|
|
||||||
clearIfNotMatch: true,
|
|
||||||
placeholder: '000.000.000.000'
|
|
||||||
});
|
|
||||||
|
|
||||||
// Domain names
|
// Domain names
|
||||||
this.ui.domain_names.selectize({
|
this.ui.domain_names.selectize({
|
||||||
delimiter: ',',
|
delimiter: ',',
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="text-monospace"><%- forward_ip %>:<%- forward_port %></div>
|
<div class="text-monospace"><%- forward_host %>:<%- forward_port %></div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div><%- certificate && certificate_id ? i18n('ssl', certificate.provider) : i18n('ssl', 'none') %></div>
|
<div><%- certificate && certificate_id ? i18n('ssl', certificate.provider) : i18n('ssl', 'none') %></div>
|
||||||
|
@ -92,7 +92,7 @@
|
|||||||
"empty": "There are no Proxy Hosts",
|
"empty": "There are no Proxy Hosts",
|
||||||
"add": "Add Proxy Host",
|
"add": "Add Proxy Host",
|
||||||
"form-title": "{id, select, undefined{New} other{Edit}} Proxy Host",
|
"form-title": "{id, select, undefined{New} other{Edit}} Proxy Host",
|
||||||
"forward-ip": "Forward IP",
|
"forward-host": "Forward Hostname / IP",
|
||||||
"forward-port": "Forward Port",
|
"forward-port": "Forward Port",
|
||||||
"delete": "Delete Proxy Host",
|
"delete": "Delete Proxy Host",
|
||||||
"delete-confirm": "Are you sure you want to delete the Proxy host for: <strong>{domains}</strong>?",
|
"delete-confirm": "Are you sure you want to delete the Proxy host for: <strong>{domains}</strong>?",
|
||||||
|
@ -11,7 +11,7 @@ const model = Backbone.Model.extend({
|
|||||||
created_on: null,
|
created_on: null,
|
||||||
modified_on: null,
|
modified_on: null,
|
||||||
domain_names: [],
|
domain_names: [],
|
||||||
forward_ip: '',
|
forward_host: '',
|
||||||
forward_port: null,
|
forward_port: null,
|
||||||
access_list_id: 0,
|
access_list_id: 0,
|
||||||
certificate_id: 0,
|
certificate_id: 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user