全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1794|回复: 4

[nginx] nginx 怎么做跳转??

[复制链接]
发表于 2011-5-23 11:51:32 | 显示全部楼层 |阅读模式
nginx 怎么做跳转??已经是反向代理某个站点。因为流量快超了。想跳转到其他服务器上。
 楼主| 发表于 2011-5-23 12:05:04 | 显示全部楼层
发表于 2011-5-23 14:45:14 | 显示全部楼层
301还是?
发表于 2011-5-23 15:05:36 | 显示全部楼层
菜鸟回复一下:
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:16 | 显示全部楼层
ls的好像可以的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-4 05:49 , Processed in 0.065488 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表