From c280caa4016b1caf16c62c5d6c239f18320b02e1 Mon Sep 17 00:00:00 2001 From: Geert Huygen Date: Mon, 6 Jan 2025 14:57:52 +0100 Subject: [PATCH] Add sitemap handling to Nginx and update Caddy config Added a new Nginx location block to allow sitemap requests to reach the Shopware application. Updated the Caddy configuration to exclude sitemap paths from the @default route matching. These changes ensure proper handling of sitemap requests in both servers. --- caddy/rootfs/etc/caddy/Caddyfile | 2 +- nginx/rootfs/etc/nginx/nginx.conf | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/caddy/rootfs/etc/caddy/Caddyfile b/caddy/rootfs/etc/caddy/Caddyfile index 6026fb4..eea1eb9 100644 --- a/caddy/rootfs/etc/caddy/Caddyfile +++ b/caddy/rootfs/etc/caddy/Caddyfile @@ -6,7 +6,7 @@ log route { @default { - not path /theme/* /media/* /thumbnail/* /bundles/* /sitemap/* + not path /theme/* /media/* /thumbnail/* /bundles/* } root * /var/www/html/public php_fastcgi @default unix//tmp/php-fpm.sock { diff --git a/nginx/rootfs/etc/nginx/nginx.conf b/nginx/rootfs/etc/nginx/nginx.conf index 454623c..6b678a8 100644 --- a/nginx/rootfs/etc/nginx/nginx.conf +++ b/nginx/rootfs/etc/nginx/nginx.conf @@ -53,6 +53,11 @@ http { deny all; } + # Allow sitemap requests to hit the shopware application + location ~ ^/sitemap/.*\.(xml|xml\.gz)$ { + try_files $uri /index.php$is_args$args; + } + location ~ ^/(theme|media|thumbnail|bundles|css|fonts|js|recovery|sitemap)/ { expires 1y; add_header Cache-Control "public, must-revalidate, proxy-revalidate";