-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
35 lines (31 loc) · 786 Bytes
/
nginx.conf
File metadata and controls
35 lines (31 loc) · 786 Bytes
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
map $http_user_agent $outdated {
default 0;
"~MSIE [1-9]\." 1;
"~MSIE 1[0-1]\." 1;
"~Mozilla.*Firefox/[1-9]\." 1;
"~Mozilla.*Firefox/[0-4][0-9]\." 1;
"~Mozilla.*Firefox/5[0-1]\." 1;
"~Opera.*Version/[0-9]\." 1;
"~Opera.*Version/[0-3][0-9]\." 1;
"~Opera.*Version/4[0-3]\." 1;
"~AppleWebKit.*Version/[0-6]\..*Safari" 1;
"~Chrome/[0-9]\." 1;
"~Chrome/[0-5][0-9]\." 1;
"~Chrome/6[0-1]\." 1;
"~Edge/[0-9]\." 1;
"~Edge/1[0-5]\." 1;
}
server {
listen 80;
root /usr/share/nginx/html;
location /outdated-browser {
try_files /outdated-browser.html /outdated-browser.html;
}
location / {
if ($outdated = 1) {
rewrite ^ /outdated-browser redirect;
}
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}