-
Notifications
You must be signed in to change notification settings - Fork 1
/
virtualHost.template
114 lines (95 loc) · 2.97 KB
/
virtualHost.template
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
server {
listen 80;
modsecurity on;
modsecurity_rules_file /usr/local/nginx/conf/modsecurity.conf;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
server_name XXXXXXXXXX;
location /_v/healthcheck {
root html;
index 200.html;
}
#add_header Content-Security-Policy "default-src 'self';";
#add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
#add_header X-XSS-Protection "1; mode=block";
#add_header X-Frame-Options "SAMEORIGIN";
#add_header X-Content-Type-Options nosniff;
#add_header Referrer-Policy "strict-origin";
#add_header Permissions-Policy "geolocation=();midi=();notifications=();push=();sync-xhr=();microphone=();camera=();magnetometer=();gyroscope=();speaker=(self);vibrate=();fullscreen=(self);payment=();";
#if ($http_user_agent ~* LWP::Simple|BBBike|wget) {
# return 403;
#}
#add_header Allow "GET, POST, HEAD" always;
#if ( $request_method !~ ^(GET|POST|HEAD)$ ) {
# return 405;
#}
error_page 400 /400.html;
location = /400.html {
root /usr/local/nginx/errorpages;
}
error_page 404 /404.html;
location = /404.html {
root /usr/local/nginx/errorpages;
}
error_page 403 /403.html;
location = /403.html {
ssi on;
root /usr/local/nginx/errorpages;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/nginx/errorpages;
}
location / {
proxy_pass http://YYYYYYYY/;
proxy_set_header Host $host;
proxy_set_header Referer https://XXXXXXXXXX/;
proxy_set_header Accept-Encoding "";
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_set_header X-NginX-Proxy true;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name XXXXXXXXXX;
modsecurity on;
modsecurity_rules_file /usr/local/nginx/conf/modsecurity.conf;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location /_v/healthcheck {
root html;
index 200.html;
}
error_page 400 /400.html;
location = /400.html {
root /usr/local/nginx/errorpages;
}
error_page 404 /404.html;
location = /404.html {
root /usr/local/nginx/errorpages;
}
error_page 403 /403.html;
location = /403.html {
root /usr/local/nginx/errorpages;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/nginx/errorpages;
}
location / {
proxy_pass https://YYYYYYYY/;
proxy_set_header Host $host;
proxy_set_header Referer https://XXXXXXXXXX/;
proxy_set_header Accept-Encoding "";
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_set_header X-NginX-Proxy true;
}
root /usr/share/nginx/html; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
ssl_certificate /root/.certs/nginx.crt;
ssl_certificate_key /root/.certs/nginx.key;
}