client_max_body_size setting

This commit is contained in:
Sergey 'dreik' Kolesnik
2024-12-09 03:17:48 +03:00
parent b3de76c945
commit d8ca38cb26
12 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,34 @@
const migrate_name = 'client_max_body_size';
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.integer('client_max_body_size').notNull().unsigned().defaultTo('1');
})
.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);
};

View File

@ -9,6 +9,7 @@
"domain_names",
"forward_host",
"forward_port",
"client_max_body_size",
"access_list_id",
"certificate_id",
"ssl_forced",
@ -52,6 +53,11 @@
"minimum": 1,
"maximum": 65535
},
"client_max_body_size": {
"type": "integer",
"minimum": 1,
"maximum": 4096
},
"access_list_id": {
"$ref": "../common.json#/properties/access_list_id"
},
@ -112,6 +118,9 @@
"forward_port": {
"$ref": "#/properties/forward_port"
},
"client_max_body_size": {
"$ref": "#/properties/client_max_body_size"
},
"forward_path": {
"type": "string"
},

View File

@ -34,6 +34,7 @@
"domain_names": ["test.example.com"],
"forward_host": "127.0.0.1",
"forward_port": 8989,
"client_max_body_size": 1,
"access_list_id": 0,
"certificate_id": 0,
"ssl_forced": false,

View File

@ -34,6 +34,7 @@
"domain_names": ["test.example.com"],
"forward_host": "192.168.0.10",
"forward_port": 8989,
"client_max_body_size": 1,
"access_list_id": 0,
"certificate_id": 0,
"ssl_forced": false,

View File

@ -41,6 +41,9 @@
"forward_port": {
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_port"
},
"client_max_body_size": {
"$ref": "../../../../components/proxy-host-object.json#/properties/client_max_body_size"
},
"certificate_id": {
"$ref": "../../../../components/proxy-host-object.json#/properties/certificate_id"
},
@ -100,6 +103,7 @@
"domain_names": ["test.example.com"],
"forward_host": "192.168.0.10",
"forward_port": 8989,
"client_max_body_size": 1,
"access_list_id": 0,
"certificate_id": 0,
"ssl_forced": false,

View File

@ -29,6 +29,9 @@
"forward_port": {
"$ref": "../../../components/proxy-host-object.json#/properties/forward_port"
},
"client_max_body_size": {
"$ref": "../../../components/proxy-host-object.json#/properties/client_max_body_size"
},
"certificate_id": {
"$ref": "../../../components/proxy-host-object.json#/properties/certificate_id"
},
@ -88,6 +91,7 @@
"domain_names": ["test.example.com"],
"forward_host": "127.0.0.1",
"forward_port": 8989,
"client_max_body_size": 1,
"access_list_id": 0,
"certificate_id": 0,
"ssl_forced": false,

View File

@ -47,6 +47,8 @@ proxy_http_version 1.1;
}
{% endif %}
client_max_body_size {{ client_max_body_size }}m;
# Custom
include /data/nginx/custom/server_proxy[.]conf;
}