全球主机交流论坛

标题: nginx 怎么做跳转?? [打印本页]

作者: seanhuang    时间: 2011-5-23 11:51
标题: nginx 怎么做跳转??
nginx 怎么做跳转??已经是反向代理某个站点。因为流量快超了。想跳转到其他服务器上。
作者: seanhuang    时间: 2011-5-23 12:05

作者: lemss    时间: 2011-5-23 14:45
301还是?
作者: lovejk8    时间: 2011-5-23 15:05
菜鸟回复一下:
server
        {
                listen       80;
                server_name www.120j9.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/www.120j9.com;

                include 120j9.com.conf;
                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                access_log /home/wwwroot/wwwlogs/120j9.log;
        }

server
{
server_name 120j9.com;

rewrite ^(.*) http://www.120j9.com$1 permanent;

}

可以从不带WWW的跳到带WWW的
不知道是不是要这个
作者: 奇尺大乳    时间: 2011-5-23 15:39
ls的好像可以的




欢迎光临 全球主机交流论坛 (https://91ai.net/) Powered by Discuz! X3.4