0

我刚刚将 Opencart 与 nginx 设置为网络服务器,但是当我尝试访问时,domain.com/我得到了403 Forbidden,但如果我访问domain.com/index.php它工作正常。

我的 nginx 虚拟主机文件如下所示(部分):

    location / {
            index index.html index.php index.htm;
            try_files $uri @opencart;
    }

    location @opencart {
            rewrite ^/(.+)$ /index.php?_route_=$1 last;
    }

我错过了什么?

4

1 回答 1

0

我改变了这个:

location / {
        index index.html index.php index.htm;
        try_files $uri @opencart;
}

对此:

location / {
        index index.html index.php index.htm;
        try_files $uri $uri/ @opencart;
}

现在可以了。

于 2013-10-30T12:07:32.227 回答