Redirect Nginx重定向到domain.com>/blog,同时仍然可以指定domain.com/mycustomdir

Redirect Nginx重定向到domain.com>/blog,同时仍然可以指定domain.com/mycustomdir,redirect,nginx,Redirect,Nginx,我正在使用nginx1.0.15 我想重定向domain.com>domain.com/wordpress,但我仍然希望能够专门浏览到domain.com/mycustomdirectory,例如domain.com/files/ 这是我当前的配置。这里已经有重写了 server { listen 80 default_server; server_name domain.com; #charset koi8-r; #access_log lo

我正在使用nginx1.0.15

我想重定向domain.com>domain.com/wordpress,但我仍然希望能够专门浏览到domain.com/mycustomdirectory,例如domain.com/files/

这是我当前的配置。这里已经有重写了

server {
    listen       80 default_server;
    server_name  domain.com;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.php index.html index.htm;
}
        location /twitter {
        rewrite ^ http://twitter.com/name permanent;
}
        location /music {
        rewrite ^ http://domain.com:8080 permanent;
}
        location /plus {
        rewrite ^ http://gplus.to/name permanent;
}

     error_page  404              /404.html;
     location = /404.html {
       root   /usr/share/nginx/html;
}

我想出来了。我刚刚用这个添加了第二个位置。location=/{rewrite^domain.com/wordpress permanent;}