I have a rewrite in my nginx.conf:
server {
server_name example.com;
rewrite ^/(.*) http://www.example.com/$1 permanent;
}
But return this error: unknown directive “rewrite”.
PS: I’ve installed nginx with passenger.
Can you help me?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check the output of nginx -V. If you see the option –without-http_rewrite_module, then you probably didn’t have the pcre development package installed when you build nginx, and so it disabled the rewrite module. If that’s the case, you’ll need to install the pcre devel packages (how to do this depends on your distro) and rebuild nginx.