Nginx: “rewrite” is not terminated by “;”

[ad_1]

rewrite ^/.*-misc?\.xml$ "/index.php?xml_sitemap=params=$2" last;
rewrite ^/.*-misc?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
rewrite ^/.*-misc?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
rewrite ^/.*-misc?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
rewrite ^/.*sitemap.*(?:\d{1,4}(?!-misc)|-misc)?\.xml$ "/index.php?xml_sitemap=params=$2" last;
rewrite ^/.*sitemap.*(?:\d{1,4}(?!-misc)|-misc)?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
rewrite ^/.*sitemap.*(?:\d{1,4}(?!-misc)|-misc)?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
rewrite ^/.*sitemap.*(?:\d{1,4}(?!-misc)|-misc)?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;

When I use this block in my Nginx config. Nginx restarts and then fails with the following error:

nginx: [emerg] directive "rewrite" is not terminated by ";"
  • This topic was modified 17 hours, 16 minutes ago by haywardgb.
  • This topic was modified 17 hours, 9 minutes ago by haywardgb.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer