Ivorde Unix/Linux/Database/Web/Mail Forum

View unanswered posts
View active topics
It is currently Sat Feb 04, 2012 10:00 pm


This forum is dedicated to Apache, Nginx, Lighttpd, Squid and other HTTP transport protocol related software

Bookmark this article:

Author Message
debuser
Post  Post subject: Starting nginx: [emerg]: directive "rewrite" is not terminated by ";"  |  Posted: Tue Feb 23, 2010 1:05 pm

Joined: Thu Aug 06, 2009 9:48 am
Posts: 90

Offline
Save on Delicious
Code:
Starting nginx: [emerg]: directive "rewrite" is not terminated by ";" in /usr/local/nginx/vhosts/www.site.com.conf:45


Even though the Nginx configuration file contains a rewrite rule which is terminated corectly (with
Code:
last;
), if a rule contains curly brackets {}, then those brackets finish the location directive in Nginx configuration prematurely, thus making Nginx complaining about line termination.

Example:
Code:
system {
                   listen  80;
...
                    location / {
...                                 
                                      rewrite ^/[a-z0-9_-]*-[a-z]{1}([0-9]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$ /gymrss.php?$8=$1&$3&$5&$7&gzip=$9 last;
...                                 
                    }                                     
}

[hence the curly brackets in [a-z]{1}([0-9]+) ].

To avoid these situations, enclose the first part of the regular expression with double quotes like below:
Code:
rewrite "^/[a-z0-9_-]*-[a-z]{1}([0-9]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$" /gymrss.php?$8=$1&$3&$5&$7&gzip=$9 last;


Top
Display posts from previous:  Sort by  
Print view

Topics related to - "Starting nginx: [emerg]: directive "rewrite" is not terminated by ";""
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Apache - Restricting "Server" information in HTTP response header with ServerTokens

debuser

0

196

Thu Nov 10, 2011 1:39 pm

debuser View the latest post

There are no new unread posts for this topic. Remove "X-Powered-By: PHP/5.2.11" from HTTP headers of your web server

debuser

0

3053

Wed Mar 24, 2010 1:49 pm

debuser View the latest post

There are no new unread posts for this topic. Phpbb 3.0.5 "Log me on automatically" cookies and sessions problem

debuser

3

6955

Wed May 19, 2010 10:08 am

admin View the latest post

There are no new unread posts for this topic. Attachment(s) Nginx + apache (for PHP) with real IP addresses in logs

designeru

0

2128

Tue May 18, 2010 4:49 pm

designeru View the latest post

There are no new unread posts for this topic. Nginx + php-fpm setting php upload_max_filesize and other php values per vhost

mandrei99

0

99

Mon Jan 02, 2012 4:04 pm

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC + 2 hours [ DST ]

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
DAJ Glass 2 template created by Dustin Baccetti

phpBB SEO