Compare commits

...

6 Commits

Author SHA1 Message Date
042167c01e 2.0.29 2019-01-22 04:03:17 +01:00
db38d038ef fix(core): update 2019-01-22 04:03:17 +01:00
a4d8a46360 2.0.28 2019-01-19 15:57:50 +01:00
84e5c10129 fix(core): update 2019-01-19 15:57:49 +01:00
98a2871f08 2.0.27 2019-01-19 15:42:46 +01:00
9bb847210a fix(core): update 2019-01-19 15:42:45 +01:00
3 changed files with 5 additions and 6 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartnginx", "name": "@pushrocks/smartnginx",
"version": "2.0.26", "version": "2.0.29",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartnginx", "name": "@pushrocks/smartnginx",
"version": "2.0.26", "version": "2.0.29",
"private": false, "private": false,
"description": "control nginx from node, TypeScript ready", "description": "control nginx from node, TypeScript ready",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -71,11 +71,11 @@ export let getBaseConfigString = () => {
return baseConfig; return baseConfig;
}; };
export let getHostConfigString = (hostNameArg: string, destinationIpArg: string, portArg = 80) => { export let getHostConfigString = (hostNameArg: string, destinationIpArg: string, destinationPortArg = 80) => {
const hostConfig = plugins.smartstring.indent.normalize(` const hostConfig = plugins.smartstring.indent.normalize(`
upstream ${hostNameArg} { upstream ${hostNameArg} {
keepalive 100; keepalive 100;
server ${destinationIpArg}; server ${destinationIpArg}:${destinationPortArg};
} }
server { server {
@ -95,13 +95,12 @@ export let getHostConfigString = (hostNameArg: string, destinationIpArg: string,
location / { location / {
http2_push_preload on; http2_push_preload on;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off; proxy_buffering off;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://${hostNameArg}:${portArg}; proxy_pass http://${hostNameArg};
} }
} }
`); `);