fix(core): update

This commit is contained in:
2019-01-19 15:41:51 +01:00
parent 221f1f6237
commit 3ee2988964
5 changed files with 14 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import * as plugins from './smartnginx.plugins';
import * as paths from './smartnginx.paths';
export let getBaseConfigString = () => {
let baseConfig = plugins.smartstring.indent.normalize(`
const baseConfig = plugins.smartstring.indent.normalize(`
user www-data;
worker_processes auto;
pid /run/nginx/nginx.pid;
@ -71,8 +71,8 @@ export let getBaseConfigString = () => {
return baseConfig;
};
export let getHostConfigString = (hostNameArg: string, destinationIpArg: string) => {
let hostConfig = plugins.smartstring.indent.normalize(`
export let getHostConfigString = (hostNameArg: string, destinationIpArg: string, portArg = 80) => {
const hostConfig = plugins.smartstring.indent.normalize(`
upstream ${hostNameArg} {
keepalive 100;
server ${destinationIpArg};
@ -101,7 +101,7 @@ export let getHostConfigString = (hostNameArg: string, destinationIpArg: string)
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://${hostNameArg};
proxy_pass http://${hostNameArg}:${portArg};
}
}
`);