nginxwebnodeplugin 1.0.370 → 1.0.372
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +21 -5
- package/package.json +22 -15
- package/readme.md +164 -13
package/index.js
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
if(typeof window==='undefined'||window===null)var window=(typeof globalThis==='undefined'||globalThis===null)?{}:globalThis;import
|
|
1
|
+
if(typeof window==='undefined'||window===null)var window=(typeof globalThis==='undefined'||globalThis===null)?{}:globalThis;import "core-js/modules/es.array.push.js";
|
|
2
|
+
import "core-js/modules/es.iterator.constructor.js";
|
|
3
|
+
import "core-js/modules/es.iterator.filter.js";
|
|
4
|
+
import "core-js/modules/es.iterator.for-each.js";
|
|
5
|
+
import { exec as __WEBPACK_EXTERNAL_MODULE_child_process_exec__, spawn as __WEBPACK_EXTERNAL_MODULE_child_process_spawn__ } from "child_process";
|
|
2
6
|
import { CLOSE_EVENT_NAMES as __WEBPACK_EXTERNAL_MODULE_clientnode_CLOSE_EVENT_NAMES__, Logger as __WEBPACK_EXTERNAL_MODULE_clientnode_Logger__, checkReachability as __WEBPACK_EXTERNAL_MODULE_clientnode_checkReachability__, checkUnreachability as __WEBPACK_EXTERNAL_MODULE_clientnode_checkUnreachability__, getProcessCloseHandler as __WEBPACK_EXTERNAL_MODULE_clientnode_getProcessCloseHandler__, represent as __WEBPACK_EXTERNAL_MODULE_clientnode_represent__ } from "clientnode";
|
|
3
7
|
import { Agent as __WEBPACK_EXTERNAL_MODULE_https_Agent__ } from "https";
|
|
4
8
|
|
|
9
|
+
;// external "core-js/modules/es.array.push.js"
|
|
10
|
+
|
|
11
|
+
;// external "core-js/modules/es.iterator.constructor.js"
|
|
12
|
+
|
|
13
|
+
;// external "core-js/modules/es.iterator.filter.js"
|
|
14
|
+
|
|
15
|
+
;// external "core-js/modules/es.iterator.for-each.js"
|
|
16
|
+
|
|
5
17
|
;// external "child_process"
|
|
6
18
|
|
|
7
19
|
;// external "clientnode"
|
|
@@ -21,11 +33,11 @@ import { Agent as __WEBPACK_EXTERNAL_MODULE_https_Agent__ } from "https";
|
|
|
21
33
|
-------
|
|
22
34
|
|
|
23
35
|
This library written by Torben Sickert stands under a creative commons
|
|
24
|
-
naming
|
|
25
|
-
See https://creativecommons.org/licenses/by/
|
|
36
|
+
naming 4.0 international license.
|
|
37
|
+
See https://creativecommons.org/licenses/by/4.0/deed.de
|
|
26
38
|
endregion
|
|
27
39
|
*/// region imports
|
|
28
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach(function(t){_defineProperty(r,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function _defineProperty(r,t,o){return(t=_toPropertyKey(t))in r?Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[t]=o,r}function _toPropertyKey(r){var o=_toPrimitive(r,"string");return"symbol"==_typeof(o)?o:o+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r;if("undefined"!=typeof Symbol&&void 0!==(r=t[Symbol.toPrimitive])){var i=r.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,e,o="function"==typeof Symbol?Symbol:{},n=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function i(o,n,a,i){var u=n&&n.prototype instanceof Generator?n:Generator,f=Object.create(u.prototype);return _regeneratorDefine2(f,"_invoke",function(t,o,n){var a,i,u,f=0,p=n||[],y=!1,G={p:0,n:0,v:r,a:l,f:l.bind(r,4),d:function d(t,e){return a=t,i=0,u=r,G.n=e,c}};function l(t,o){for(i=t,u=o,e=0;!y&&f&&!n&&e<p.length;e++){var n,a=p[e],l=G.p,F=a[2];t>3?(n=F===o)&&(u=a[(i=a[4])?5:(i=3,3)],a[4]=a[5]=r):a[0]<=l&&((n=t<2&&l<a[1])?(i=0,G.v=o,G.n=a[1]):l<F&&(n=t<3||a[0]>o||o>F)&&(a[4]=t,a[5]=o,G.n=F,i=0))}if(n||t>1)return c;throw y=!0,o}return function(n,p,F){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&l(p,F),i=p,u=F;(e=i<2?r:u)||!y;){a||(i?
|
|
40
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach(function(t){_defineProperty(r,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function _defineProperty(r,t,o){return(t=_toPropertyKey(t))in r?Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[t]=o,r}function _toPropertyKey(r){var o=_toPrimitive(r,"string");return"symbol"==_typeof(o)?o:o+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r;if("undefined"!=typeof Symbol&&void 0!==(r=t[Symbol.toPrimitive])){var i=r.call(t,e||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,e,o="function"==typeof Symbol?Symbol:{},n=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function i(o,n,a,i){var u=n&&n.prototype instanceof Generator?n:Generator,f=Object.create(u.prototype);return _regeneratorDefine2(f,"_invoke",function(t,o,n){var a,i,u,f=0,p=n||[],y=!1,G={p:0,n:0,v:r,a:l,f:l.bind(r,4),d:function d(t,e){return a=t,i=0,u=r,G.n=e,c}};function l(t,o){for(i=t,u=o,e=0;!y&&f&&!n&&e<p.length;e++){var n,a=p[e],l=G.p,F=a[2];t>3?(n=F===o)&&(u=a[(i=a[4])?5:(i=3,3)],a[4]=a[5]=r):a[0]<=l&&((n=t<2&&l<a[1])?(i=0,G.v=o,G.n=a[1]):l<F&&(n=t<3||a[0]>o||o>F)&&(a[4]=t,a[5]=o,G.n=F,i=0))}if(n||t>1)return c;throw y=!0,o}return function(n,p,F){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&l(p,F),i=p,u=F;(e=i<2?r:u)||!y;){a||(i?(i>1&&(G.n=i<3?-1:u),l(i,u)):G.v=u);try{if(f=2,a){if(i||(n="next"),e=a[n]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,i<2&&(i=0)}else 1===i&&(e=a.return)&&e.call(a),i<2&&(u=TypeError("The iterator does not provide a '"+n+"' method"),i=1);a=r}else if((e=(y=G.n<0)?u:t.call(o,G))!==c)break}catch(t){a=r,i=1,u=t}finally{f=1}}return{value:e,done:y}}}(o,a,i),!0),f}var c={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}e=Object.getPrototypeOf;var u=[][n]?e(e([][n]())):(_regeneratorDefine2(e={},n,function(){return this}),e),f=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(u);function p(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,GeneratorFunctionPrototype):(r.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(r,a,"GeneratorFunction")),r.prototype=Object.create(f),r}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(f,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,a,"GeneratorFunction"),_regeneratorDefine2(f),_regeneratorDefine2(f,a,"Generator"),_regeneratorDefine2(f,n,function(){return this}),_regeneratorDefine2(f,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:p}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function _createForOfIteratorHelper(e,t){var _n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!_n){if(Array.isArray(e)||(_n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){_n&&(e=_n);var o=0,F=function F(){};return{s:F,n:function n(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u,i=!0;return{s:function s(){_n=_n.call(e)},n:function n(){i=!0;var r=_n.next();return r.done?{done:!0}:{value:r.value,done:i=!1}},e:function e(r){a=!0,u=r},f:function f(){try{i||null==_n.return||_n.return()}finally{if(a)throw u}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}};// endregion
|
|
29
41
|
var log=new __WEBPACK_EXTERNAL_MODULE_clientnode_Logger__({name:"web-node.nginx"});// region plugins/classes
|
|
30
42
|
/**
|
|
31
43
|
* Launches an application server und triggers all some pluginable hooks on
|
|
@@ -40,7 +52,11 @@ var log=new __WEBPACK_EXTERNAL_MODULE_clientnode_Logger__({name:"web-node.nginx"
|
|
|
40
52
|
* @param state.services - An object with stored service instances.
|
|
41
53
|
* @returns A mapping to promises which correspond to the plugin specific
|
|
42
54
|
* continues services.
|
|
43
|
-
*/var loadService=/*#__PURE__*/function(){var _loadService=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref){var configuration,services,nginx,promise,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:configuration=_ref.configuration.applicationServer,services=_ref.services;if(!services.nginx){_context.n=1;break}return _context.a(2,null);case 1:nginx=__WEBPACK_EXTERNAL_MODULE_child_process_spawn__("nginx",[],{cwd:process.cwd(),env:process.env
|
|
55
|
+
*/var loadService=/*#__PURE__*/function(){var _loadService=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref){var configuration,services,nginx,promise,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:configuration=_ref.configuration.applicationServer,services=_ref.services;if(!services.nginx){_context.n=1;break}return _context.a(2,null);case 1:nginx=__WEBPACK_EXTERNAL_MODULE_child_process_spawn__("nginx",[],{cwd:process.cwd(),env:process.env,/*
|
|
56
|
+
NOTE: No shell here since e.g. "dash" (default "/bin/sh" on
|
|
57
|
+
debian) does not forward signals to its child so nginx could
|
|
58
|
+
not be stopped.
|
|
59
|
+
*/stdio:"inherit"});services.nginx=nginx;nginx.reload=function(){return new Promise(function(resolve,reject){return __WEBPACK_EXTERNAL_MODULE_child_process_exec__("nginx -s reload",{env:process.env},function(error,standardOutput,standardErrorOutput){if(error){error.standardErrorOutput=standardErrorOutput;/*
|
|
44
60
|
eslint-disable
|
|
45
61
|
@typescript-eslint/prefer-promise-reject-errors
|
|
46
62
|
*/reject(error);/*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nginxwebnodeplugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.372",
|
|
4
4
|
"description": "A nginx proxy server configuration template for webNode.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"email": "info@tsickert.com",
|
|
16
16
|
"url": "https://github.com/thaibault/nginx-web-node-plugin/issues"
|
|
17
17
|
},
|
|
18
|
-
"license": "CC-BY-
|
|
18
|
+
"license": "CC-BY-4.0",
|
|
19
19
|
"author": {
|
|
20
20
|
"email": "info@tsickert.com",
|
|
21
21
|
"name": "Torben Sickert",
|
|
@@ -50,28 +50,31 @@
|
|
|
50
50
|
"watch": "weboptimizer build --watch"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@babel/
|
|
53
|
+
"@babel/core": "^8.1.2",
|
|
54
|
+
"@babel/eslint-parser": "^8.1.2",
|
|
54
55
|
"@eslint/js": "^10.0.1",
|
|
55
56
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
56
57
|
"@types/node": "^26.6.6",
|
|
57
58
|
"@types/webpack-env": "^1.18.8",
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "^8.72.
|
|
59
|
-
"@typescript-eslint/parser": "^8.72.
|
|
60
|
-
"application-server-web-node-plugin": "^1.0.
|
|
61
|
-
"clientnode": "^4.0.
|
|
62
|
-
"
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^8.72.2",
|
|
60
|
+
"@typescript-eslint/parser": "^8.72.2",
|
|
61
|
+
"application-server-web-node-plugin": "^1.0.418",
|
|
62
|
+
"clientnode": "^4.0.1532",
|
|
63
|
+
"core-js": "^3.51.0",
|
|
64
|
+
"eslint": "^10.15.0",
|
|
63
65
|
"eslint-config-google": "^0.14.0",
|
|
64
|
-
"eslint-plugin-jsdoc": "^65.4.
|
|
66
|
+
"eslint-plugin-jsdoc": "^65.4.7",
|
|
65
67
|
"jest": "^30.5.2",
|
|
66
68
|
"jsdoc": "^4.0.5",
|
|
67
69
|
"node-fetch": "^3.3.2",
|
|
68
|
-
"typescript-eslint": "^8.72.
|
|
69
|
-
"web-documentation": "^1.0.
|
|
70
|
-
"web-node": "^1.0.
|
|
71
|
-
"weboptimizer": "^4.0.
|
|
70
|
+
"typescript-eslint": "^8.72.2",
|
|
71
|
+
"web-documentation": "^1.0.74",
|
|
72
|
+
"web-node": "^1.0.641",
|
|
73
|
+
"weboptimizer": "^4.0.118"
|
|
72
74
|
},
|
|
73
75
|
"peerDependencies": {
|
|
74
76
|
"application-server-web-node-plugin": "*",
|
|
77
|
+
"core-js": "*",
|
|
75
78
|
"node-fetch": "*",
|
|
76
79
|
"web-node": "*"
|
|
77
80
|
},
|
|
@@ -87,8 +90,12 @@
|
|
|
87
90
|
"yarn": ">=4"
|
|
88
91
|
},
|
|
89
92
|
"webDocumentation": {
|
|
90
|
-
"
|
|
91
|
-
|
|
93
|
+
"languages": [
|
|
94
|
+
"enUS",
|
|
95
|
+
"deDE",
|
|
96
|
+
"frFR"
|
|
97
|
+
],
|
|
98
|
+
"name": "nginx-web-node-plugin"
|
|
92
99
|
},
|
|
93
100
|
"webNode": {
|
|
94
101
|
"applicationServer": {
|
package/readme.md
CHANGED
|
@@ -7,11 +7,13 @@ License
|
|
|
7
7
|
-------
|
|
8
8
|
|
|
9
9
|
This library written by Torben Sickert stands under a creative commons naming
|
|
10
|
-
|
|
10
|
+
4.0 international license.
|
|
11
|
+
See https://creativecommons.org/licenses/by/4.0/deed.de
|
|
11
12
|
endregion -->
|
|
12
13
|
|
|
13
14
|
<!--|deDE:Projektstatus-->
|
|
14
|
-
|
|
15
|
+
<!--|frFR:État du projet-->
|
|
16
|
+
Project status
|
|
15
17
|
--------------
|
|
16
18
|
|
|
17
19
|
[](https://www.npmjs.com/package/nginx-web-node-plugin)
|
|
@@ -29,11 +31,39 @@ Project Status
|
|
|
29
31
|
[](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/deploy-web-documentation.yaml)
|
|
30
32
|
[](https://tsickert.com/nginx-web-node-plugin)
|
|
31
33
|
|
|
32
|
-
<!--|deDE:
|
|
34
|
+
<!--|deDE:Einsatzmöglichkeiten-->
|
|
35
|
+
<!--|frFR:Cas d'utilisation-->
|
|
33
36
|
Use case
|
|
34
37
|
--------
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
This [web-node](https://tsickert.com/web-node) plugin starts an
|
|
40
|
+
[nginx](https://nginx.org) process as reverse proxy in front of your
|
|
41
|
+
application server and stops it again when the application exits. Your
|
|
42
|
+
application keeps a single entry point while nginx terminates TLS, serves
|
|
43
|
+
static files or balances load.
|
|
44
|
+
<!--deDE:
|
|
45
|
+
Dieses [web-node](https://tsickert.com/web-node)-Plugin startet einen
|
|
46
|
+
[nginx](https://nginx.org)-Prozess als Reverse-Proxy vor Ihrem
|
|
47
|
+
Anwendungsserver und beendet ihn wieder, wenn die Anwendung beendet wird.
|
|
48
|
+
Ihre Anwendung behält einen einzigen Einstiegspunkt, während nginx TLS
|
|
49
|
+
terminiert, statische Dateien ausliefert oder Last verteilt.
|
|
50
|
+
-->
|
|
51
|
+
<!--frFR:
|
|
52
|
+
Ce plugin [web-node](https://tsickert.com/web-node) démarre un processus
|
|
53
|
+
[nginx](https://nginx.org) comme proxy inverse devant votre serveur
|
|
54
|
+
d'application et l'arrête lorsque l'application se termine. Votre
|
|
55
|
+
application conserve un point d'entrée unique tandis que nginx gère le
|
|
56
|
+
TLS, sert les fichiers statiques ou répartit la charge.
|
|
57
|
+
-->
|
|
58
|
+
|
|
59
|
+
Features included:
|
|
60
|
+
<!--deDE:Enthaltene Funktionen:-->
|
|
61
|
+
<!--frFR:Fonctionnalités incluses:-->
|
|
62
|
+
|
|
63
|
+
- Starts and stops nginx together with your application.<!--deDE:Startet und stoppt nginx zusammen mit Ihrer Anwendung.--><!--frFR:Démarre et arrête nginx en même temps que votre application.-->
|
|
64
|
+
- Waits until the proxy URL is reachable before the application continues.<!--deDE:Wartet, bis die Proxy-URL erreichbar ist, bevor die Anwendung fortfährt.--><!--frFR:Attend que l'URL du proxy soit joignable avant que l'application continue.-->
|
|
65
|
+
- Optional mode: the application keeps running if nginx is not available.<!--deDE:Optionaler Modus: Die Anwendung läuft weiter, wenn nginx nicht verfügbar ist.--><!--frFR:Mode optionnel: l'application continue de fonctionner si nginx n'est pas disponible.-->
|
|
66
|
+
- Reload nginx at runtime, e.g. after its configuration changed.<!--deDE:nginx zur Laufzeit neu laden, z. B. nachdem sich seine Konfiguration geändert hat.--><!--frFR:Recharger nginx à l'exécution, par exemple après une modification de sa configuration.-->
|
|
37
67
|
|
|
38
68
|
<div class="wd-table-of-contents">
|
|
39
69
|
<h2 id="content">Content<!--deDE:Inhalt--><!--frFR:Contenu--></h2>
|
|
@@ -43,19 +73,140 @@ Nginx server as WebNode plugin.
|
|
|
43
73
|
Installation
|
|
44
74
|
------------
|
|
45
75
|
|
|
46
|
-
|
|
47
|
-
|
|
76
|
+
nginx has to be installed on the system and available as "nginx" in the
|
|
77
|
+
"PATH". Install the plugin next to web-node and the
|
|
78
|
+
[application server plugin](https://tsickert.com/application-server-web-node-plugin)
|
|
79
|
+
it depends on. web-node discovers every installed package whose name ends
|
|
80
|
+
with "-web-node-plugin" automatically:
|
|
48
81
|
<!--deDE:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
82
|
+
nginx muss auf dem System installiert und als "nginx" im "PATH" verfügbar
|
|
83
|
+
sein. Installieren Sie das Plugin neben web-node und dem
|
|
84
|
+
[Anwendungsserver-Plugin](https://tsickert.com/application-server-web-node-plugin),
|
|
85
|
+
von dem es abhängt. web-node erkennt jedes installierte Paket, dessen Name
|
|
86
|
+
auf "-web-node-plugin" endet, automatisch:
|
|
52
87
|
-->
|
|
53
88
|
<!--frFR:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
89
|
+
nginx doit être installé sur le système et disponible sous le nom "nginx"
|
|
90
|
+
dans le "PATH". Installez le plugin à côté de web-node et du
|
|
91
|
+
[plugin de serveur d'application](https://tsickert.com/application-server-web-node-plugin)
|
|
92
|
+
dont il dépend. web-node détecte automatiquement chaque paquet installé
|
|
93
|
+
dont le nom se termine par "-web-node-plugin":
|
|
57
94
|
-->
|
|
58
95
|
|
|
59
96
|
```bash
|
|
60
|
-
|
|
97
|
+
yarn add web-node application-server-web-node-plugin nginx-web-node-plugin
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
<!--|deDE:Konfiguration-->
|
|
101
|
+
<!--|frFR:Configuration-->
|
|
102
|
+
Configuration
|
|
103
|
+
-------------
|
|
104
|
+
|
|
105
|
+
The plugin starts nginx without arguments, so nginx reads its default
|
|
106
|
+
configuration file (usually "/etc/nginx/nginx.conf"). It has to contain
|
|
107
|
+
"daemon off;", otherwise nginx detaches and the plugin can not track or stop
|
|
108
|
+
it. The plugin settings live below "webNode.applicationServer.proxy" in your
|
|
109
|
+
application's "package.json":
|
|
110
|
+
<!--deDE:
|
|
111
|
+
Das Plugin startet nginx ohne Argumente, sodass nginx seine
|
|
112
|
+
Standard-Konfigurationsdatei liest (meist "/etc/nginx/nginx.conf"). Sie
|
|
113
|
+
muss "daemon off;" enthalten, sonst löst sich nginx vom Prozess und das
|
|
114
|
+
Plugin kann es weder überwachen noch beenden. Die Plugin-Einstellungen
|
|
115
|
+
liegen unterhalb von "webNode.applicationServer.proxy" in der
|
|
116
|
+
"package.json" Ihrer Anwendung:
|
|
117
|
+
-->
|
|
118
|
+
<!--frFR:
|
|
119
|
+
Le plugin démarre nginx sans argument, nginx lit donc son fichier de
|
|
120
|
+
configuration par défaut (généralement "/etc/nginx/nginx.conf"). Celui-ci
|
|
121
|
+
doit contenir "daemon off;", sinon nginx se détache et le plugin ne peut
|
|
122
|
+
ni le suivre ni l'arrêter. Les paramètres du plugin se trouvent sous
|
|
123
|
+
"webNode.applicationServer.proxy" dans le "package.json" de votre
|
|
124
|
+
application:
|
|
125
|
+
-->
|
|
126
|
+
|
|
127
|
+
```JSON
|
|
128
|
+
{
|
|
129
|
+
"webNode": {
|
|
130
|
+
"applicationServer": {
|
|
131
|
+
"proxy": {
|
|
132
|
+
"optional": false,
|
|
133
|
+
"url": "https://127.0.0.1/"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
- "url": Address nginx answers on. It is polled for up to three seconds after
|
|
141
|
+
start and must answer with a status code below 400. Defaults to
|
|
142
|
+
"http://127.0.0.1/".<!--deDE:"url": Adresse, unter der nginx antwortet. Sie wird nach dem Start bis zu drei Sekunden lang abgefragt und muss mit einem Statuscode unter 400 antworten. Standardmäßig "http://127.0.0.1/".--><!--frFR:"url": Adresse à laquelle nginx répond. Elle est interrogée pendant trois secondes au maximum après le démarrage et doit répondre avec un code de statut inférieur à 400. Par défaut "http://127.0.0.1/".-->
|
|
143
|
+
- "optional": If "true" (default) a failing nginx only logs a warning,
|
|
144
|
+
otherwise the application stops.<!--deDE:"optional": Bei "true" (Standard) erzeugt ein fehlschlagendes nginx nur eine Warnung, andernfalls wird die Anwendung beendet.--><!--frFR:"optional": Si "true" (par défaut), un échec de nginx ne produit qu'un avertissement, sinon l'application s'arrête.-->
|
|
145
|
+
- "logFilePath.access" and "logFilePath.error": Log destinations, defaulting
|
|
146
|
+
to standard output and standard error. They are meant to be used in a
|
|
147
|
+
generated nginx configuration, see below.<!--deDE:"logFilePath.access" und "logFilePath.error": Log-Ziele, standardmäßig Standardausgabe und Standardfehlerausgabe. Sie sind für die Verwendung in einer generierten nginx-Konfiguration gedacht, siehe unten.--><!--frFR:"logFilePath.access" et "logFilePath.error": Destinations des journaux, par défaut la sortie standard et la sortie d'erreur standard. Elles sont destinées à une configuration nginx générée, voir ci-dessous.-->
|
|
148
|
+
|
|
149
|
+
<!--|deDE:nginx-Konfiguration generieren-->
|
|
150
|
+
<!--|frFR:Générer la configuration nginx-->
|
|
151
|
+
### Generating the nginx configuration
|
|
152
|
+
|
|
153
|
+
Combined with the [EJS plugin](https://tsickert.com/ejs-web-node-plugin) you
|
|
154
|
+
can derive the nginx configuration from the same web-node configuration. A
|
|
155
|
+
template "nginx.conf.ejs" is rendered to "nginx.conf" before nginx starts.
|
|
156
|
+
Link it to the location nginx reads, e.g. "/etc/nginx/nginx.conf":
|
|
157
|
+
<!--deDE:
|
|
158
|
+
In Kombination mit dem
|
|
159
|
+
[EJS-Plugin](https://tsickert.com/ejs-web-node-plugin) können Sie die
|
|
160
|
+
nginx-Konfiguration aus derselben web-node-Konfiguration ableiten. Eine
|
|
161
|
+
Vorlage "nginx.conf.ejs" wird vor dem Start von nginx zu "nginx.conf"
|
|
162
|
+
gerendert. Verlinken Sie sie an den Ort, den nginx liest, z. B.
|
|
163
|
+
"/etc/nginx/nginx.conf":
|
|
164
|
+
-->
|
|
165
|
+
<!--frFR:
|
|
166
|
+
Combiné au [plugin EJS](https://tsickert.com/ejs-web-node-plugin), vous
|
|
167
|
+
pouvez dériver la configuration nginx de la même configuration web-node.
|
|
168
|
+
Un modèle "nginx.conf.ejs" est transformé en "nginx.conf" avant le
|
|
169
|
+
démarrage de nginx. Liez-le à l'emplacement lu par nginx, par exemple
|
|
170
|
+
"/etc/nginx/nginx.conf":
|
|
171
|
+
-->
|
|
172
|
+
|
|
173
|
+
```EJS
|
|
174
|
+
<%_ const server = _.configuration.applicationServer _%>
|
|
175
|
+
daemon off;
|
|
176
|
+
|
|
177
|
+
events {}
|
|
178
|
+
http {
|
|
179
|
+
access_log <%- server.proxy.logFilePath.access %>;
|
|
180
|
+
error_log <%- server.proxy.logFilePath.error %>;
|
|
181
|
+
|
|
182
|
+
server {
|
|
183
|
+
listen 80;
|
|
184
|
+
|
|
185
|
+
location / {
|
|
186
|
+
proxy_pass http://<%- server.hostName %>:<%- server.port %>;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
<!--|deDE:Dienste-->
|
|
193
|
+
<!--|frFR:Services-->
|
|
194
|
+
Services
|
|
195
|
+
--------
|
|
196
|
+
|
|
197
|
+
- "services.nginx": The running nginx child process or "null" if it is
|
|
198
|
+
optional and could not be started.<!--deDE:"services.nginx": Der laufende nginx-Kindprozess oder "null", falls er optional ist und nicht gestartet werden konnte.--><!--frFR:"services.nginx": Le processus enfant nginx en cours d'exécution ou "null" s'il est optionnel et n'a pas pu être démarré.-->
|
|
199
|
+
- "services.nginx.reload()": Runs "nginx -s reload".<!--deDE:"services.nginx.reload()": Führt "nginx -s reload" aus.--><!--frFR:"services.nginx.reload()": Exécute "nginx -s reload".-->
|
|
200
|
+
- "checkReachability(configuration.applicationServer)": Waits until the proxy
|
|
201
|
+
URL answers, exported for use in other plugins.<!--deDE:"checkReachability(configuration.applicationServer)": Wartet, bis die Proxy-URL antwortet; für andere Plugins exportiert.--><!--frFR:"checkReachability(configuration.applicationServer)": Attend que l'URL du proxy réponde, exporté pour d'autres plugins.-->
|
|
202
|
+
|
|
203
|
+
<!--|deDE:Entwicklung-->
|
|
204
|
+
<!--|frFR:Développement-->
|
|
205
|
+
Development
|
|
206
|
+
-----------
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
yarn install
|
|
210
|
+
yarn build
|
|
211
|
+
yarn test
|
|
61
212
|
```
|