diff --git a/.docker/vhost.conf b/.docker/vhost.conf index 2ab6ccf..3ba74cd 100644 --- a/.docker/vhost.conf +++ b/.docker/vhost.conf @@ -9,8 +9,14 @@ server { proxy_pass http://node:3000; add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; - add_header Pragma "no-cache"; - add_header Expires "0"; + } + + location /client/online-check/ { + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $http_host; + proxy_pass http://node:3000; + + add_header Cache-Control "public, max-age=604800"; } location /client/ws { diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f12c4f..9a6144d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. ## Unreleased +- [#141](https://github.com/os2display/display-client/pull/141) + - Avoided setting ER105 in url when no token exists in local storage. + ## [2.1.1] - 2024-10-23 - [#138](https://github.com/os2display/display-client/pull/138) diff --git a/infrastructure/itkdev/etc/confd/templates/default.conf.tmpl b/infrastructure/itkdev/etc/confd/templates/default.conf.tmpl index e35f3a9..43c1b8f 100644 --- a/infrastructure/itkdev/etc/confd/templates/default.conf.tmpl +++ b/infrastructure/itkdev/etc/confd/templates/default.conf.tmpl @@ -4,8 +4,6 @@ server { root /var/www/html; add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; - add_header Pragma "no-cache"; - add_header Expires "0"; location {{ getenv "APP_SCREEN_CLIENT_PATH" "/" }} { rewrite ^{{ getenv "APP_SCREEN_CLIENT_PATH" "/" }}(.*) /$1 break; @@ -15,6 +13,10 @@ server { try_files $uri $uri/ =404; } + location = {{ getenv "APP_SCREEN_CLIENT_PATH" "" }}/online-check/ { + add_header Cache-Control "public, max-age=604800"; + } + location = {{ getenv "APP_SCREEN_CLIENT_PATH" "" }}/robots.txt { add_header Content-Type text/plain; add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; diff --git a/infrastructure/os2display/etc/confd/templates/default.conf.tmpl b/infrastructure/os2display/etc/confd/templates/default.conf.tmpl index e35f3a9..2c77dc7 100644 --- a/infrastructure/os2display/etc/confd/templates/default.conf.tmpl +++ b/infrastructure/os2display/etc/confd/templates/default.conf.tmpl @@ -15,6 +15,10 @@ server { try_files $uri $uri/ =404; } + location = {{ getenv "APP_SCREEN_CLIENT_PATH" "" }}/online-check/ { + add_header Cache-Control "public, max-age=604800"; + } + location = {{ getenv "APP_SCREEN_CLIENT_PATH" "" }}/robots.txt { add_header Content-Type text/plain; add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";