Subdirectory still redirecting to www. despite rule

Valentin V. Bartenev ne at vbart.ru
Wed Sep 19 07:21:04 UTC 2012


On Wednesday 19 September 2012 04:25:53 Ian M. Evans wrote:
[...]
> location ^~ /blogs {
>   try_files $uri /blogs/index.php?q=$uri;
>   location ~ \.php$ {
>   fastcgi_pass 127.0.0.1:10004;
> }
> }
> if ($uri ~ (/blogs/[^/]*)) {
>   set $blogname $1;
> }

  location /blogs {

      ...

      location ~ ^/blogs/([^/]+) {
         ...
      }
  }

But your example config is completely broken. Probably you do not understand how 
"location" works. If so, you should read these articles:

 http://nginx.org/en/docs/http/request_processing.html
 http://nginx.org/r/location


> location ^~ /blogs/$blogname {

Variables are not allowed here.

 wbr, Valentin V. Bartenev



More information about the nginx mailing list