Skip to content

Commit

Permalink
Add sitemap handling to Nginx and update Caddy config
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GeertHuygen committed Jan 6, 2025
1 parent 97db4b2 commit c280caa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion caddy/rootfs/etc/caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions nginx/rootfs/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit c280caa

Please sign in to comment.