This repository has been archived by the owner on Jul 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
scheme.conf
84 lines (61 loc) · 1.94 KB
/
scheme.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
limit_req_zone $remote_addr zone={zone}:{rate_limit} rate={rate_pr};
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {domain};
root /var/www/{domain}/public;
# SSL
ssl_certificate /etc/letsencrypt/live/{domain}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{domain}/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/{domain}/chain.pem;
# security
include nginxconfig.io/security.conf;
# reverse proxy
location / {
limit_req zone={zone} burst={dynBurst};
include sites/{domain}/preproxy.conf;
proxy_pass {passProtocol}://{passIP}:{passPort};
include nginxconfig.io/proxy.conf;
}
location ~* \.(?:css(\.map)?|js(\.map)?|swf|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ {
expires 7d;
access_log off;
limit_req zone={zone} burst={staBurst};
include sites/{domain}/preproxy.conf;
proxy_pass {passProtocol}://{passIP}:{passPort};
include nginxconfig.io/proxy.conf;
}
location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff2?)$ {
add_header Access-Control-Allow-Origin "*";
expires 7d;
access_log off;
limit_req zone={zone} burst={staBurst};
include sites/{domain}/preproxy.conf;
proxy_pass {passProtocol}://{passIP}:{passPort};
include nginxconfig.io/proxy.conf;
}
# additional config
include nginxconfig.io/general.conf;
include sites/{domain}/serverblock.conf;
}
# subdomains redirect
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name *.{domain};
# SSL
ssl_certificate /etc/letsencrypt/live/{domain}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{domain}/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/{domain}/chain.pem;
return 301 https://{domain}$request_uri;
}
server {
listen 80;
listen [::]:80;
server_name .{domain};
include nginxconfig.io/letsencrypt.conf;
location / {
limit_req zone={zone} burst={dynBurst};
return 301 https://{domain}$request_uri;
}
}