generated from samply/lens-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
60 lines (53 loc) · 1.63 KB
/
nginx.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
server {
listen ${NGINX_PORT};
server_name ${NGINX_SERVER_NAME};
root /usr/share/nginx/html;
index index.html index.htm;
include /etc/nginx/mime.types;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types
text/css
text/plain
text/javascript
application/javascript
application/json
application/x-javascript
application/xml
application/xml+rss
application/xhtml+xml
application/x-font-ttf
application/x-font-opentype
application/vnd.ms-fontobject
image/svg+xml
image/x-icon
application/rss+xml
application/atom_xml;
location /de/ {
alias /usr/share/nginx/html/de/;
try_files $uri$args $uri$args/ /de/index.html;
}
location /en/ {
alias /usr/share/nginx/html/en/;
try_files $uri$args $uri$args/ /en/index.html;
}
set $first_language $http_accept_language;
if ($http_accept_language ~* '^(.+?),') {
set $first_language $1;
}
set $language_suffix 'de';
if ($first_language ~* 'de') {
set $language_suffix 'de';
}
if ($first_language ~* 'en') {
set $language_suffix 'en';
}
location / {
rewrite ^/$ http://${NGINX_SERVER_NAME}/$language_suffix/index.html permanent;
}
location ~* .(js|css|ttf|ttc|otf|eot|woff|woff2)$ {
add_header access-control-allow-origin "*";
expires max;
}
}