diff --git a/config/nginx.conf b/config/nginx.conf index 93bb7ad5..999b464c 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -33,7 +33,7 @@ http { server { listen 80 default; - access_log /var/log/nginx/access.log nginx_main; + access_log /var/log/nginx/access.log nginx_main; error_log /var/log/nginx/error.log error; charset utf-8; @@ -55,8 +55,8 @@ http { gzip_min_length 256; gzip_types application/atom+xml - application/geo+json - application/javascript + application/geo+json + application/javascript application/x-javascript application/json application/ld+json @@ -75,36 +75,41 @@ http { text/xml; location / { - root /frontend; - index index.html; - try_files $uri @index; + root /frontend; + index index.html; + try_files $uri @index; - # Media: images, icons, video, audio, HTC - location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc|woff2|woff|ttf)$ { - expires 1M; - access_log off; - # max-age must be in seconds - add_header Cache-Control "max-age=2629746, public"; - } - # CSS and Javascript - location ~* \.(?:css|js)$ { - expires 1y; - access_log off; - add_header Cache-Control "max-age=31556952, public"; - } - } + #Application config + location = /src/resources/app-config.json { + add_header Cache-Control "no-cache"; + expires 0; + } + # Media: images, icons, video, audio, HTC + location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc|woff2|woff|ttf)$ { + expires 1M; + access_log off; + # max-age must be in seconds + add_header Cache-Control "max-age=2629746, public"; + } + # CSS and Javascript + location ~* \.(?:css|js)$ { + expires 1y; + access_log off; + add_header Cache-Control "max-age=31556952, public"; + } + } - location @index { - root /frontend; - add_header Cache-Control no-cache; - expires 0; - try_files /index.html =404; - } + location @index { + root /frontend; + add_header Cache-Control "no-cache"; + expires 0; + try_files /index.html =404; + } - location = /health { - access_log off; - add_header 'Content-Type' 'application/json'; - return 200 '{"status":"UP"}'; - } + location = /health { + access_log off; + add_header 'Content-Type' 'application/json'; + return 200 '{"status":"UP"}'; + } } }