nginx下强制跳转到www域名

#先监听 yepk.cn域名,然后转发到www下面,今天刚做的跳转
server {
  listen         80;
  server_name    yepk.cn;

  rewrite ^(.*) $scheme://www.$server_name$1 permanent;
}

#www.yepk.cn配置
server {
  listen       80;
  root         path;
  server_name  www.yepk.cn;
  
  location ~ \.php$ {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  	 
    $document_root$fastcgi_script_name;
    include        fastcgi_params;
   }
}
# https   nginx  

评论

企鹅群:39438021

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×