# Nginx: directive "rewrite" is not terminated by "; " in /usr/local/nginx/conf/nginx.conf:67

**URL:** <https://www.ruby-forum.com/t/nginx-directive-rewrite-is-not-terminated-by-in-usr-local-nginx-conf-nginx-conf-67/217575>\
**Category:** NGINX\
**Created:** [March 5, 2012, 5:12pm UTC](https://www.ruby-forum.com/t/nginx-directive-rewrite-is-not-terminated-by-in-usr-local-nginx-conf-nginx-conf-67/217575 "2012-03-05T17:12:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 5, 2012, 5:12pm UTC](https://www.ruby-forum.com/t/nginx-directive-rewrite-is-not-terminated-by-in-usr-local-nginx-conf-nginx-conf-67/217575/1 "2012-03-05T17:12:24Z")

</div>

63 rewrite ^/rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$  
/gymrss.php?channels&$2&$4&$6 last;  
64 rewrite ^/(news|maps)/?(page([0-9]+).html)?$ /map.php?$1&start=$3  
last;  
66 rewrite  
^/(news|maps)/([a-z0-9\_-]+)(/([a-z0-9\_-]+))?/?(page([0-9]+).html)?$  
/map.php?$2=$4&$1&start=$6 last;  
67 rewrite  
^/rss(/(news)+)?(/(digest)+)?(/(short|long)+)?(/([a-z0-9\_-]+))?/([a-z0-9\_]+).xml(.gz)?$  
/gymrss.php?$9=$8&$2&$4&$6&gzip=$10 last;  
68 rewrite  
^/[a-z0-9\_-]\*-[a-z]{1,2}([0-9]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9\_]+).xml(.gz)?$  
/gymrss.php?$8=$1&$3&$5&$7&gzip=$9 last;  
69 rewrite  
^/([a-z0-9\_-]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9\_]+).xml(.gz)?$  
/gymrss.php?nametoid=$1&$3&$5&$7&modulename=$8&gzip=$9 last;  
70 rewrite ^/sitemapindex.xml(.gz)?$ /sitemap.php?gzip=$1 last;  
71 rewrite ^/[a-z0-9\_-]±([a-z]{1,2})([0-9]+).xml(.gz)?$  
/sitemap.php?module\_sep=$1&module\_sub=$2&gzip=$3 last;  
72 rewrite ^/([a-z0-9\_]+)-([a-z0-9\_-]+).xml(.gz)?$  
/sitemap.php?$1=$2&gzip=$3 last;

So what exactly am I missing?

---

<div class="post-metadata">

**Author:** ![adam\_estes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@adam\_estes](https://www.ruby-forum.com/u/adam_estes)\
**Post date:** [March 5, 2012, 5:27pm UTC](https://www.ruby-forum.com/t/nginx-directive-rewrite-is-not-terminated-by-in-usr-local-nginx-conf-nginx-conf-67/217575/2 "2012-03-05T17:27:23Z")

</div>

Hello!

On Mon, Mar 05, 2012 at 11:11:46AM -0500, adam estes wrote:

> /gymrss.php?nametoid=$1&$3&$5&$7&modulename=$8&gzip=$9 last;  
> 70 rewrite ^/sitemapindex.xml(.gz)?$ /sitemap.php?gzip=$1 last;  
> 71 rewrite ^/[a-z0-9\_-]±([a-z]{1,2})([0-9]+).xml(.gz)?$  
> /sitemap.php?module\_sep=$1&module\_sub=$2&gzip=$3 last;  
> 72 rewrite ^/([a-z0-9\_]+)-([a-z0-9\_-]+).xml(.gz)?$  
> /sitemap.php?$1=$2&gzip=$3 last;
> 
> So what exactly am I missing?

> **[Module ngx\_http\_rewrite\_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)**
>
> The ngx\_http\_rewrite\_module module is used to change request URI using PCRE regular expressions, return redirects, and conditionally select configurations.

If a regular expression includes the characters “}” or “;”, the  
whole expressions should be enclosed in single or double quotes.

Line numbers provided above looks off-by-one for some reason,  
the problematic line is marked as “68”.

Maxim D.
