generated from garronej/keycloakify-demo-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
37 lines (28 loc) · 1.01 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
# NOTE: This file will only work with an app hosted at root
# it is not the case here ("homename": "https://.../keyclaokify-demo-app")
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
# Any route containing a file extension (e.g. /devicesfile.js)
location ~ ^.+\..+$ {
try_files $uri =404;
location ~* \.(?:html|json|txt)$ {
expires -1;
}
# CRA generates filenames with hashes so we can
# tell the browser to keep in cache the resources.
location ~* \.(?:css|js|md|woff2?|eot|ttf|xml)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
# Allow fonts and scripts to be downloaded from pages
# served by Keycloak (CORS for --external-request)
# We allow .md for beeing able to fetch the terms of service.
location ~* \.(?:js|woff2?|eot|ttf|xml|md)$ {
add_header Access-Control-Allow-Origin *;
}
}
}
}