阅读367 返回首页    go 阿里云 go 技术社区[云栖]


nginx站点配置之域名301重定向

今天为xiaochunchun做301跳转了,记录一下,方便下次使用:

server {

        listen       80;
        server_name  www.xiaochunchun.com xiaochunchun.com;
        if ($host != 'www.xiaochunchun.com' ) {
          rewrite ^/(.*)$ https://www.xiaochunchun.com/$1 permanent;
        }

        index index.html index.htm index.php;
        root /alidata/www/ycsc/web;
        location ~ .*\.(php|php5)?$
        {
                #fastcgi_pass  unix:/tmp/php-cgi.sock;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi.conf;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                expires 30d;
        }
        location ~ .*\.(js|css)?$
        {
                expires 1h;
        }
   
        include /alidata/server/nginx/conf/rewrite/phpwind.conf;
        access_log  /alidata/log/nginx/access/ycsc.log;
}

最后更新:2017-04-04 07:36:07

  上一篇:go 数据库事务
  下一篇:go SQL SERVER中Case的使用方法