Compare commits

...

12 Commits

Author SHA1 Message Date
0aa6966dc1 2.0.37 2019-01-22 22:42:54 +01:00
5bbd773460 fix(core): update 2019-01-22 22:42:54 +01:00
2c81f8b492 2.0.36 2019-01-22 22:07:59 +01:00
0fe7d586cf fix(core): update 2019-01-22 22:07:58 +01:00
a4c8b789ad 2.0.35 2019-01-22 22:05:03 +01:00
b4378e305a fix(core): update 2019-01-22 22:05:02 +01:00
5ff0980908 2.0.34 2019-01-22 18:59:56 +01:00
e60257d761 fix(core): update 2019-01-22 18:59:55 +01:00
e94f0edafb 2.0.33 2019-01-22 18:25:44 +01:00
c417d96e48 fix(core): update 2019-01-22 18:25:43 +01:00
c5b1dbb46e 2.0.32 2019-01-22 12:33:48 +01:00
893a2e2709 fix(core): update 2019-01-22 12:33:47 +01:00
3 changed files with 6 additions and 7 deletions

2
package-lock.json generated
View File

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

View File

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

View File

@ -72,9 +72,8 @@ export let getBaseConfigString = () => {
};
export let getHostConfigString = (hostNameArg: string, destinationIpArg: string, destinationPortArg = 80) => {
let uniqueString = plugins.smartunique.shortId()
const hostConfig = plugins.smartstring.indent.normalize(`
upstream ${uniqueString} {
upstream ${hostNameArg} {
keepalive 100;
server ${destinationIpArg}:${destinationPortArg};
}
@ -96,11 +95,11 @@ export let getHostConfigString = (hostNameArg: string, destinationIpArg: string,
location / {
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_redirect off;
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 $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://${uniqueString};
proxy_pass http://${hostNameArg};
}
}
`);