Posted by superfedya on August 29, 2012 at 5:24am
Hi,
After switching my site to Nginx my sitemap module stops working correctly:
http://madfanboy.com/sitemap.xml
Seems that this config doesn't work:
## XML Sitemap support.
location = /sitemap.xml {
try_files $uri /index.php?q=$no_slash_uri;
}Any suggestion?
Thanks

Comments
I thinks nginx doesn't works
I thinks nginx doesn't works correctly with the links like:
http://madfanboy.com/sitemap.xml?page=1
http://madfanboy.com/sitemap.xml?page=2
And always redirect them to http://madfanboy.com/sitemap.xml
I put everything on the 1 page and it works.
Does your map include
Does your map include $args?
map $uri&$args $no_slash_uri {default '';
~^/(?<key>.*)$ $key;
}
EDIT: Yeah, that needs a fix: https://github.com/perusio/drupal-with-nginx/blob/master/map_drupal6.conf
No need to do that
just use ;)
## XML Sitemap support.location = /sitemap.xml {
try_files $uri /index.php?q=$no_slash_uri&$args;
}
it will works even for:
it will works even for: sitemap.xml?page=1?
Yes
by virtue of the
$argsthat was as added.FWIW, the following config
FWIW, the following config worked for me, Drupal 7 on nginx:
location @xmlrewrite {# Some modules enforce no slash (/) at the end of the URL
# Else this rewrite block wouldn't be needed (GlobalRedirect)
rewrite ^/(.*)$ /index.php?q=$1;
}
## XML Sitemap support.
location = /sitemap.xml {
try_files $uri @xmlrewrite;
}
Having the same problem on latest version of Perusio's config.
Hi,
I'm using D7 and the latest version of Perusio's configurations from github. I've chosen the basic Drupal seting: https://github.com/perusio/drupal-with-nginx/blob/D7/apps/drupal/drupal....
## XML Sitemap support.location = /sitemap.xml {
try_files $uri @drupal-no-args;
}
This does not work when the sitemap is large and gets split. I tried Perusio's suggestion with no luck:
location = /sitemap.xml {try_files $uri /index.php?q=$no_slash_uri&$args;
}
Nginx does not start because it doesn't know the variable $no_slash_uri.
I also used used z.stolar suggestion but it did not work.
Everything else is working.
Thank you in advance for helping.
That is for D6
for D7 just do:
location = /sitemap.xml {try_files $uri @drupal;
}