Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
1a8546af6e | |||
9e01bdb8e2 | |||
33833fbc6c | |||
97b5678fe4 | |||
9b96984413 | |||
0de412b842 | |||
64bcce9e23 | |||
390812ec33 | |||
a672bb920f | |||
c3fabb6107 | |||
b4ebdbae47 | |||
c55d2dcf10 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartnginx",
|
"name": "@pushrocks/smartnginx",
|
||||||
"version": "2.0.18",
|
"version": "2.0.24",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartnginx",
|
"name": "@pushrocks/smartnginx",
|
||||||
"version": "2.0.18",
|
"version": "2.0.24",
|
||||||
"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",
|
||||||
|
@ -74,27 +74,33 @@ export let getBaseConfigString = () => {
|
|||||||
export let getHostConfigString = (hostNameArg: string, destinationIpArg: string) => {
|
export let getHostConfigString = (hostNameArg: string, destinationIpArg: string) => {
|
||||||
let hostConfig = plugins.smartstring.indent.normalize(`
|
let hostConfig = plugins.smartstring.indent.normalize(`
|
||||||
upstream ${hostNameArg} {
|
upstream ${hostNameArg} {
|
||||||
|
keepalive 100;
|
||||||
server ${destinationIpArg};
|
server ${destinationIpArg};
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
# The keepalive parameter sets the maximum number of idle keepalive connections
|
||||||
|
# to upstream servers that are preserved in the cache of each worker process. When
|
||||||
|
# this number is exceeded, the least recently used connections are closed.
|
||||||
listen *:80 ;
|
listen *:80 ;
|
||||||
server_name ${hostNameArg};
|
server_name ${hostNameArg};
|
||||||
rewrite ^ https://${hostNameArg}$request_uri? permanent;
|
rewrite ^ https://${hostNameArg}$request_uri? permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen *:443 ssl;
|
listen *:443 ssl http2;
|
||||||
server_name ${hostNameArg};
|
server_name ${hostNameArg};
|
||||||
ssl_certificate ${paths.nginxHostDirPath}/${hostNameArg}.public.pem;
|
ssl_certificate ${paths.nginxHostDirPath}/${hostNameArg}.public.pem;
|
||||||
ssl_certificate_key ${paths.nginxHostDirPath}/${hostNameArg}.private.pem;
|
ssl_certificate_key ${paths.nginxHostDirPath}/${hostNameArg}.private.pem;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_set_header Host $http_host;
|
http2_push_preload on;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_redirect off;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header Host $http_host;
|
||||||
proxy_pass http://${hostNameArg};
|
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};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
|
Reference in New Issue
Block a user