全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1782|回复: 4
打印 上一主题 下一主题

[nginx] nginx 怎么做跳转??

[复制链接]
跳转到指定楼层
1#
发表于 2011-5-23 11:51:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
nginx 怎么做跳转??已经是反向代理某个站点。因为流量快超了。想跳转到其他服务器上。
2#
 楼主| 发表于 2011-5-23 12:05:04 | 只看该作者
3#
发表于 2011-5-23 14:45:14 | 只看该作者
301还是?
4#
发表于 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的
不知道是不是要这个
5#
发表于 2011-5-23 15:39:16 | 只看该作者
ls的好像可以的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-2 07:12 , Processed in 0.059040 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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