I'm trying to rewrite a particular url, but it doesn't seem to work unless a subdomain is included as part of the url. For example, given the following:
server {
server_name .example.com ;
listen 80 default;
root /usr/share/nginx/www/example/public;
rewrite ^ /test redirect;
}
http://www.example.com/original correctly redirects to http://www.example.com/test. But http://example.com/original does not?
I'm running nginx 1.0.11 (custom built) on a Fedora box if that helps.
EDIT: PS - I've also tried server_name example.com *.example.com with no luck.
error_logverbosity tonotice, and turn onrewrite_log. See if anything relevant shows up in the error logs, and post the relevant sections here. (You can also add the same directives to the http block to see that the error is not originating elsewhere). – cyberx86 Jan 4 at 4:29