You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CodeIgniter 4+Nginx环境下VTiger登录后出现404错误求助

问题:CodeIgniter 4 + VTiger 登录后跳转404错误

我使用CodeIgniter 4、Composer搭配MySQL数据库搭建VTiger网站,已按照CodeIgniter官方文档完成安装。当前遇到的问题是:登录页面可正常访问,输入正确的登录凭证后(无任何凭证错误提示),网站直接跳转至404页面。此前曾出现401未授权错误,修改Nginx配置后变为当前的404问题。

以下是我的Nginx配置文件:

server {
    root /var/www/html/mydomain.com/;
    error_log /var/log/nginx/mydomain.com.error.log debug;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html index.php;
    server_name mydomain.com;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
    # pass PHP scripts to FastCGI server
    #
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    location ~ /\. {
        deny all;
    }

    listen [::]:443 ssl http2; # managed by Certbot
    listen 443 ssl http2; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem; # managed by Certbot
    #include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    #ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    }

    server {
        if ($host = mydomain.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
    server_name mydomain.com;
    listen [::]:80;
    listen 80;
    # return 404; # managed by Certbot
    }

已完成的排查步骤:

  • 已检查PHP必要扩展,确认符合CodeIgniter 4运行要求

希望有经验的开发者帮忙定位问题或提供排查方向,如需更多配置信息请告知。

内容的提问来源于stack exchange,提问作者Brayan Martinez Espinosa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 01:00:08