閱讀993 返回首頁    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-03 16:49:13

  上一篇:go 端口檢測工具Fport的使用
  下一篇:go android讀取sd卡圖片並進行縮放操作