nginx: [emerg] invalid number of arguments in “return” directive

I was using a 4 year old installation of nginx (0.7) – apt-get update, apt-get install nginx claimed I had the latest version…

Turns out this error means the return directive isn’t supported in the `return 301 foo.com` format until a later nginx.

Install the latest nginx by following the docs at http://wiki.nginx.org/Install

sudo -s
nginx=stable # use nginx=development for latest development version
add-apt-repository ppa:nginx/$nginx
apt-get update 
apt-get install nginx
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s