NGINX服务器上的混凝土5,后端JS未加载



我创建了一个Concrete5站点,该站点在Apache上运行了一年,之后我切换到了一个使用NGINX而不是Apache的主机,该主机不允许完全访问NGINX,只允许访问所需的。

主机确实为Wordpress提供了这段代码,这似乎也适用于Concrete5:

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

每个前端页面都在加载,但在管理模式下,导航栏不会显示,每个模式也不会显示。

有人知道怎么解决这个问题吗?

谢谢!

concrete5网站上实际上有一篇关于NGINX的好文章,你应该在这里看看:http://www.concrete5.org/documentation/how-tos/developers/nginx-with-fastcgi_cache-php5-fpm/

域配置.conf文件:

location ~* .(ico|css|js|gif|jpe?g|png)(?[0-9]+)?$ {
    expires max;
    log_not_found off;
}
set $skip_cache 0;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
    set $skip_cache 1;
}
if ($query_string != "") {
    set $skip_cache 1;
}
if ($http_cookie ~ "CONCRETE5") {
    set $skip_cache 1;
}
location / {
    try_files $uri $uri/ /index.php$uri;
    if (!-f $request_filename){
        set $rule_0 1$rule_0;
    }
    if (!-d $request_filename){
        set $rule_0 2$rule_0;
    }
    if ($rule_0 = "21"){
        rewrite ^/(.*)$ /index.php/$1 last;
    }
}

最新更新