Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
0aa6966dc1 | |||
5bbd773460 | |||
2c81f8b492 | |||
0fe7d586cf | |||
a4c8b789ad | |||
b4378e305a | |||
5ff0980908 | |||
e60257d761 | |||
e94f0edafb | |||
c417d96e48 | |||
c5b1dbb46e | |||
893a2e2709 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartnginx",
|
"name": "@pushrocks/smartnginx",
|
||||||
"version": "2.0.31",
|
"version": "2.0.37",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartnginx",
|
"name": "@pushrocks/smartnginx",
|
||||||
"version": "2.0.31",
|
"version": "2.0.37",
|
||||||
"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",
|
||||||
|
@ -72,9 +72,8 @@ export let getBaseConfigString = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export let getHostConfigString = (hostNameArg: string, destinationIpArg: string, destinationPortArg = 80) => {
|
export let getHostConfigString = (hostNameArg: string, destinationIpArg: string, destinationPortArg = 80) => {
|
||||||
let uniqueString = plugins.smartunique.shortId()
|
|
||||||
const hostConfig = plugins.smartstring.indent.normalize(`
|
const hostConfig = plugins.smartstring.indent.normalize(`
|
||||||
upstream ${uniqueString} {
|
upstream ${hostNameArg} {
|
||||||
keepalive 100;
|
keepalive 100;
|
||||||
server ${destinationIpArg}:${destinationPortArg};
|
server ${destinationIpArg}:${destinationPortArg};
|
||||||
}
|
}
|
||||||
@ -96,11 +95,11 @@ export let getHostConfigString = (hostNameArg: string, destinationIpArg: string,
|
|||||||
location / {
|
location / {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
proxy_set_header Host $http_host;
|
proxy_redirect off;
|
||||||
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 $remote_addr;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_pass http://${uniqueString};
|
proxy_pass http://${hostNameArg};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
|
Reference in New Issue
Block a user