From 4d9fec20bc1e6aa6d26cc053402f21a30bb4dbe7 Mon Sep 17 00:00:00 2001 From: Peter Turek Date: Fri, 20 Sep 2024 13:53:33 +0200 Subject: [PATCH] returns only static content from vshosting CDN (#25) --- UPGRADE.md | 4 ++++ kubernetes/configmap/nginx.yaml | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 34e49bf..4bd942d 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -10,6 +10,10 @@ 2. Run `composer update shopsys/deployment` 3. Check files in mentioned pull requests and if you have any of them extended in your project, apply changes manually +## Upgrade from v3.2.4 to v3.2.5 + +- returns only static content from vshosting CDN ([#25](https://github.com/shopsys/deployment/pull/25)) + ## Upgrade from v3.2.3 to v3.2.4 - nginx app location for customer uploaded file added ([#21](https://github.com/shopsys/deployment/pull/21)) diff --git a/kubernetes/configmap/nginx.yaml b/kubernetes/configmap/nginx.yaml index f941b60..00686bd 100644 --- a/kubernetes/configmap/nginx.yaml +++ b/kubernetes/configmap/nginx.yaml @@ -187,7 +187,19 @@ data: } } + location ^~ /_next/ { + try_files @storefront @storefront; + } + + # disallow access to dynamic content from CDN location ~ / { + if ($http_cdn_vshosting_real_ip != '') { + return 410; + } + if ($http_cdn_vshosting_real_ip_img != '') { + return 410; + } + try_files @storefront @storefront; }