全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

[nginx] nginx 怎么做跳转??

[复制链接]
1#
发表于 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的
不知道是不是要这个
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-16 12:04 , Processed in 0.057390 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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