forked from LykkeCorp/lykke.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
61 lines (49 loc) · 1.53 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
61
env ENV_INFO;
env APP_VERSION;
worker_processes 1;
events { worker_connections 1024; }
http {
include /etc/nginx/mime.types;
sendfile on;
gzip on;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_types text/plain text/xml text/css
text/comma-separated-values
text/javascript
application/javascript
application/x-javascript
application/atom+xml;
# Configuration for the server
# include /etc/nginx/conf.d/*.conf;
server {
listen 80;
# server_name wallet-dev.lykke.com;
root /usr/share/nginx/html;
index index.html index.htm;
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
}
location ~* \.(?:css|js)$ {
try_files $uri =404;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
# Any route containing a file extension (e.g. /devicesfile.js)
location ~ ^.+\..+$ {
try_files $uri =404;
}
location ~ ^/api/isalive$ {
set_by_lua $env_info_cnt 'return os.getenv("ENV_INFO")';
set_by_lua $app_version 'return os.getenv("APP_VERSION")';
return 200 '{"Version": "$app_version", "Env": "$env_info_cnt"}';
}
# Any route that doesn't have a file extension (e.g. /devices)
location / {
try_files $uri $uri/ /index.html;
}
}
}