@bprotsyk/aso-core 2.0.56 → 2.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -3
- package/lib/templates/nginx-template.d.ts +1 -0
- package/lib/templates/nginx-template.js +39 -0
- package/{src/templates/nginx-template.conf → lib/templates/nginx-template.ts} +2 -1
- package/lib/utils/server-util.d.ts +0 -42
- package/lib/utils/server-util.js +302 -315
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/templates/nginx-template.ts +36 -0
- package/src/utils/server-util.ts +366 -389
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -30,4 +30,4 @@ export { IKeitaroStream } from "./keitaro/keitaro-stream"
|
|
|
30
30
|
export { ICloudflareDomainStatus, ICloudflareDomainType, ICloudflareDomain } from "./general/cloudflare-domain"
|
|
31
31
|
export { IDomain, IDomainSetupResult, DomainStatus, DomainTarget, CONST_CLOUFLARE_STATUS_READY, IDomainsBuyRequestResponse, getDomainTargetByIp } from "./general/domain"
|
|
32
32
|
export { INamecheapDomain, INamecheapBuyRequest, INamecheapContactInfo, NamecheapBuyRequestSchema, INamecheapGetDomainsResult, INamecheapBuyResult } from "./general/namecheap-domain"
|
|
33
|
-
export {
|
|
33
|
+
export {NginxTemplate} from "./templates/nginx-template";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const NginxTemplate=`server {
|
|
2
|
+
server_name {{domain}};
|
|
3
|
+
listen 80;
|
|
4
|
+
|
|
5
|
+
return 301 https://{{domain}}$request_uri;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
server {
|
|
9
|
+
listen 443 ssl;
|
|
10
|
+
|
|
11
|
+
ssl_certificate "/etc/letsencrypt/live/{{domain}}/fullchain.pem";
|
|
12
|
+
ssl_certificate_key "/etc/letsencrypt/live/{{domain}}/privkey.pem";
|
|
13
|
+
ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
|
|
14
|
+
ssl_prefer_server_ciphers on;
|
|
15
|
+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
16
|
+
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
|
|
17
|
+
ssl_stapling on;
|
|
18
|
+
|
|
19
|
+
error_log /var/log/nginx/{{domain}}.error.log error;
|
|
20
|
+
|
|
21
|
+
root {{rootPath}}{{domain}};
|
|
22
|
+
error_page 404 /policy/index.html;
|
|
23
|
+
|
|
24
|
+
server_name www.{{domain}} {{domain}};
|
|
25
|
+
|
|
26
|
+
location / {
|
|
27
|
+
root {{rootPath}}{{domain}};
|
|
28
|
+
add_header 'Access-Control-Allow-Origin' '*';
|
|
29
|
+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
30
|
+
add_header 'Access-Control-Allow-Headers' 'Origin, Authorization, Accept, Content-Type, X-Requested-With';
|
|
31
|
+
if ($request_method = 'OPTIONS') {
|
|
32
|
+
return 204;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`
|