在nginx服务部署startbbs

1. 在ubuntu+nginx部署后出现index.php/install无限重定向的问题。在本地window则无问题。解决方案,在本地安装后将数据库直接还原到服务器,跳过安装流程。
2. 首页打开布局乱了,图片,css ,js所有静态文件 都打不开。以后是nginx配置出错,利用别的已经在运行的配置运行startbbs问题依旧,折腾许久许久,后来才发现不知道为什么页面上都是https而不是http.而用http是可以打开静态文件的。
3. 在app/config/config.php中将config['base_url']由默认的空改为“http://xxx.com”才解决问题。
nginx配置如下:


server {
        #listen   80; ## listen for ipv4; this line is default and implied
        #listen   [::]:80 default ipv6only=on; ## listen for ipv6


        root /srv/www/forum/public_html;
        index index.php index.html index.htm;

        server_name xxx.com;

        error_log /srv/www/forum/logs/nginx.error.log;
        access_log /srv/www/forum/logs/nginx.access.log;

        location / {
                if (-e $request_filename) { 
                        break;
                }
                if (!-e $request_filename) { 
                        rewrite ^/(.*)$ /index.php/$1 last;
                        #rewrite "^/(.*)$" /index.php last;
                }
        }

        location ~ .+\\.php($|/) {
                fastcgi_pass    127.0.0.1:9000;
                fastcgi_index   index.php;
                fastcgi_split_path_info ^(.+\\.php)(.*)$;
                include         fastcgi_params;
                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;
                #fastcgi_param PATH_INFO $path_info;
        }
        

}

 

startbbs官方主页:http://startbbs.com

posted @   hurner  Views(829)  Comments(0Edit  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
· 使用C#创建一个MCP客户端
点击右上角即可分享
微信分享提示