forked from InseeFr/Massive-Attack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
35 lines (30 loc) · 988 Bytes
/
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
server {
listen 80 default_server;
server_name /usr/share/nginx/html;
root /usr/share/nginx/html;
index index.html;
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
# enable cors (micro-frontend)
add_header Access-Control-Allow-Origin *;
# access_log logs/static.log; # I don't usually include a static log
}
location ~* \.(?:css|js)$ {
try_files $uri =404;
expires 1y;
access_log off;
# enable cors (micro-frontend)
add_header Access-Control-Allow-Origin *;
}
# Any route containing a file extension (e.g. /devicesfile.js)
location ~ ^.+\..+$ {
try_files $uri =404;
add_header Access-Control-Allow-Origin *;
}
# Any route that doesn't have a file extension (e.g. /devices)
location / {
try_files $uri $uri/ /index.html;
# enable cors (micro-frontend)
add_header Access-Control-Allow-Origin *;
}
}