NGINX Configuration Error using Codex Example: Is This a Typo in Codex?
Posted
by
jw60660
on Server Fault
See other posts from Server Fault
or by jw60660
Published on 2012-06-10T20:39:05Z
Indexed on
2012/06/10
22:42 UTC
Read the original article
Hit count: 301
I installed NGINX using this tutorial:
but after reading this article on security issues with "cut and paste" configuration tutorials:
Neal Poole's article regarding security and NGINX configuration
I decided to follow Poole's suggestion to use the configuration suggested in the WordPress codex:
I used the Codex configuration for a multisite installation using W3 Total Cache. When attempting to start NGINX I get an error saying that the /etc/nginx/nginx.conf test failed. The error message was:
"Restarting nginx: nginx: [emerg] unknown directive "//" in /etc/nginx/sites-enabled/teambrazil.com:18"
When I looked at my site specific configuration at that path I noticed the rewrite rule in the server block was:
rewrite ^ $scheme://teambrazil.conf$request_uri redirect;
That line in the Codex example was:
rewrite ^ $scheme://mysite.conf$request_uri redirect;
That looked like a mistake to me, and I changed my line to:
rewrite ^ $scheme://teambrazil.com$request_uri redirect;
I then attempted to restart NGINX but got the same error message.
My question is: is that a mistake, and is there anything more I have to do aside from restarting NGINX after making this change.
As suggested by both tutorials I set up the directories: /etc/nginx/sites-enabled and /etc/nginx/sites-available and created the appropriate symbolic links using:
touch /etc/nginx/sites-available/teambrazil.com
ln -s /etc/nginx/sites-available/teambrazil.com /etc/nginx/sites-enabled/teambrazil.com
Is there something else I need to consider after making this correction? Or was it not an error in the first place? I'm pretty stuck here.
BTW, I am using Debian squeeze as an OS on Amerinoc's VPS. I'm just getting familiar with VPS administration and am pretty much a noob.
Thanks very much, would appreciate any input.
© Server Fault or respective owner