I had a site running on Debian 9 on nginx. Today I did a fresh install of Debain 8 with nginx on same machine but now nginx -t
shows following error:
Invalid number of arguments in rewrite directive
Here's my code. Please note I was using the same on Debian 9 without issues and now when I use the same on Debain 8, I get this error. The error is coming from line which says sitemap
and if I comment it, then it throws error on next line and so on.
location / {
try_files $uri $uri/ = 404;
rewrite ^/([^&]*)&(.*)$ https://www.example.com/$1?$2 permanent;
rewrite ^/((?i)sitemap-([^./]+)\.xml)$/misc.php?google_seo_sitemap=$2;
rewrite ^/((?i)Forum-([^./]+))$/forumdisplay.php?google_seo_forum=$2;
rewrite^/((?i)Thread-([^./]+))$/showthread.php?google_seo_thread=$2;
rewrite^/((?i)Announcement-([^./]+))$/announcements.php?google_seo_announcement=$2;
rewrite ^/((?i)User-([^./]+))$/member.php?action=profile&google_seo_user=$2;
rewrite ^/((?i)Calendar-([^./]+))$/calendar.php?google_seo_calendar=$2;
rewrite ^/((?i)Event-([^./]+))$/calendar.php?action=event&google_seo_event=$2;
}
0 Answers