这个框架支持作为二级目录部署吗?


因为前后端分离的问题, 我想将前端网站作为顶级域名部署, 而服务端作为/server这种二级目录的形式部署, 不知道这个框架支持吗?


我试了下(网站根目录仍指向public目录), 发现并没有用, 会找不到文件(/server/h2.html, 我自己写的静态文件), 特来求问, 比较急, 谢谢!


nginx中配置文件:

location /server {
        root        /Users/zcm/deploy/dan/server/public;
        index        index.php index.html index.htm;
        autoindex    off;


        if (!-e $request_filename) {
           rewrite  ^(.*)$  /server/index.php?s=$1 last;
           break;
        }
    }

    location /server/api/ {
        index        index.php index.html index.htm;

        if (!-e $request_filename) {
           rewrite  ^/api/(.*)$  /server/api.php?s=$1 last;
           break;
        }
    }

    location ~* ^\/upload\/.+\.(html|php)$ {
        return 404;
    }
    
    location ~* ^\/plugins\/.+\.(html|php)$ {
        return 404;
    }
    
    location ~* ^\/themes\/.+\.(html|php)$ {
        return 404;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

    location ~ \.php$ {
        root        /Users/zcm/deploy/dan/server/public;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    location ~ /index.php {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
        include fastcgi_params;
    }


打赏

评论

暂时关闭,稍后恢复~
文档请看10遍以上!有问题可加QQ群!
发表话题

源素材推荐

提问必知

0.话题发布后没及时显示,请联系官方QQ群管理;
1.话题支持代码,qq截屏直接粘贴,和QQ群一样;
2.问题描述清,比如服务器版本,程序版本;
3.能上代码,就不用文字;
4.把问题发到话题后再发QQ群;
5.如果感觉回复者解答的不错,可以发红包!
6.多帮助别人也是对自己的锻炼!
7.付费讨论中只有提问者和付费用户才可以查看回复

积分规则

1.评论积分+1;每天最多10次奖励
2.发布话题积分+1;每天最多5次奖励
3.垃圾评论积分-500;
4.黄色,暴力,违反我国法律评论直接封号


ThinkCMF 8.0.1发布啦!节日快乐! 立即体验!