fix(core): update

This commit is contained in:
2019-01-22 12:11:31 +01:00
parent 44403863d1
commit 736a42066c
4 changed files with 55 additions and 7 deletions

View File

@ -10,5 +10,6 @@ import * as smartpromise from '@pushrocks/smartpromise';
import * as smartshell from '@pushrocks/smartshell';
import * as smartfile from '@pushrocks/smartfile';
import * as smartstring from '@pushrocks/smartstring';
import * as smartunique from '@pushrocks/smartunique';
export { lik, smartlog, smartpromise, smartshell, smartfile, smartstring };
export { lik, smartlog, smartpromise, smartshell, smartfile, smartstring, smartunique };

View File

@ -72,7 +72,12 @@ export let getBaseConfigString = () => {
};
export let getHostConfigString = (hostNameArg: string, destinationIpArg: string, destinationPortArg = 80) => {
const hostConfig = plugins.smartstring.indent.normalize(`
let uniqueString = plugins.smartunique.shortId()
const hostConfig = plugins.smartstring.indent.normalize(`
upstream ${uniqueString} {
keepalive 100;
server ${destinationIpArg}:${destinationPortArg};
}
server {
# The keepalive parameter sets the maximum number of idle keepalive connections
@ -84,19 +89,18 @@ export let getHostConfigString = (hostNameArg: string, destinationIpArg: string,
}
server {
listen *:443 ssl http2;
listen *:443 ssl;
server_name ${hostNameArg};
ssl_certificate ${paths.nginxHostDirPath}/${hostNameArg}.public.pem;
ssl_certificate_key ${paths.nginxHostDirPath}/${hostNameArg}.private.pem;
location / {
http2_push_preload on;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://${destinationIpArg}:${destinationPortArg};
proxy_pass http://${uniqueString};
}
}
`);