购物车中还没有商品,赶紧选购吧!

思途CMS Nginx服务器伪静态配置

发布日期:2023-11-17 阅读:609

思途CMS nginx 伪静态规则

 

   为了让Stourweb Cms 更好的在Nginx+fastcig环境下运行,思途官方做成如下示范文件,如下列所示,其中思途配置是必须要引入的,基础配置、首页入口、

php运行模式需要您根据自己的服务器环境做出最优的配置与优化。


注,如果使用宝塔,只需要在网站设置-》伪静态-》添加标注绿色的代码

 

server {

    #基础配置

    server_name www.stourweb.com stourweb.com;

    listen 80 ;

    index index.php;

    root /www/web/stourweb;#你的网站所在目录

 

    location / {

            if (!-e $request_filename) {

                rewrite  ^(.*)$  /index.php?s=/$1  last;

               break;

           }

           index  index.html index.htm index.php;

            #autoindex  on;

        }

 

#PHP 运行模式

location ~ ^(.+.php)(.*)$ {

    fastcgi_split_path_info ^(.+.php)(.*)$;

    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;

    fastcgi_param  SCRIPT_FILENAME    $document_root/$fastcgi_script_name;

    fastcgi_param  PATH_INFO          $fastcgi_path_info;

    include fastcgi.conf;

    fastcgi_pass  127.0.0.1:9000;

    fastcgi_index index.php;

}

 

    #这段是子站规则,如网址是www.abc.com,红色部分替换为abc.com

if ($http_host ~ "^(.*)?.abc.com$"){

set $rule_0 1$rule_0;

set $bref_1 $1;

}

if ($bref_1 !~* ^www|m$){

     rewrite ^/(lines|hotels|cars|spots|raiders|photos)(/)?$ http://$bref_1.abc.com/$1/$bref_1 last;

}

#这段是子站规则

 

 

    #思途配置 stourweb_conf

    #思途已将你所需要的nginx配置文件,统一整理到了网站根目录下 stourweb_conf/nginx/中,除system.conf(系统标准配置)外,其他均为应用配置

    #在线安装完成以后,只需重新启动nginx,不再做其他配置即可使用

    #/www/web/stourweb为网站根目录,需您根据自己的需要重新配置

    include /www/web/stourweb/stourweb_conf/nginx/*.conf;


如果使用的非宝塔搭建的网站,可同样在站点配置文件中引入nginx伪静态配置文件,官方的配置文件路径在 /站点目录/stourweb_conf/nginx/*.conf




以上内容是否对您有帮助? 您的反馈信息提交成功,谢谢您的反馈!

会员评论

在线客服
微信咨询
微信咨询
现在咨询,获取演示账号
企业logo小米
立即扫码加我微信
电话咨询
咨询电话
028-61558715
预约演示