首页 > 解决方案 > 将我的 Joomla 网站从 Apache 迁移到 NginX 时无法通过引用错误传递参数 1

问题描述

当我在server_name www.domain.com. 如果我提供相同的 Joomla 目录,则没有错误server_name test.domain.com

我有一个在 AWS EC2 实例上的生产服务器,过去几年在 Apache Web 服务器下运行顺利,我正在尝试迁移整个 Joomla 安装以由不同环境中的 NginX/PHP 容器提供服务。

所以我刚拿到文件和数据库并开始测试。当我在 www.dev.domain.com(开发环境以及 test.domain.com(生产环境)上进行测试时,一切都很好。

当我更改为 www.domain.com 时出现了问题,我尝试了不同的 server_names。我尝试提供一个 index.html 文件而不是我的原始 index.php 文件,并且即使我手动将它放在 URL 的末尾或者即使我将它设置为我的 nginx.conf 作为索引也可以正常工作;Joomla 后端(管理)在 www.domain.com/administrator 上运行良好我尝试server_name domain.com www.domain.com test.domain.com;了我的配置,但只有 test.domain.com 可以正常工作。

*在没有错误的情况下,该网站功能齐全

server {
    listen       80;
    server_name domain.com www.domain.com test.domain.com;
    server_name_in_redirect off;
    root /var/www/html;
    index index.php;
    access_log /logs/access.log;
    location ~ [^/]\.php(/|$) {
            proxy_cache my_cache;
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            if (!-f $document_root$fastcgi_script_name) {
                    return 404;
            }
            fastcgi_param HTTP_PROXY "";
            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_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            server_tokens off;
    try_files $uri $uri/ /index.php?$args;
    }
}

我希望该站点能够顺利运行,没有任何问题,因为它在 test.domain.com server_name 下运行良好,但我收到以下错误:

0 无法通过引用传递参数 1 请尝试以下页面之一: HOME PAGE

标签: phpapachenginxjoomlauri

解决方案


Problem Solved. There was a published Virtual Domain into my Joomla installation. A setting configured from my predecessor system administrator or maybe my company's web developers. So, I unpublished that through my.domain.com/administrator console components->Virtual Domains and everything went smooth as well with my server_name www.domain.com


推荐阅读