Silverstripe NGINX Tiny MCE 编辑器未加载

Silverstripe NGINX Tiny MCE 编辑器未加载

我在 NGINX 下运行 Silverstripe CMS。一切正常,直到我尝试修改 CMS 中的页面。Tiny MCE 编辑器由于某种原因无法正常工作。tiny_mce_gzip.php 已正确下载(200),但我在控制台中看到错误“Uncaught ReferenceError:tinyMCE 未定义”。

这是我的 Silverstripe CMS 的 NGINX 配置文件:

    location / {
            try_files $uri @silverstripe;
    }

    location @silverstripe {
        fastcgi_keep_conn on;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_read_timeout 120;
        fastcgi_connect_timeout 60;
        fastcgi_send_timeout 120;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 65k;
        fastcgi_busy_buffers_size 128k;

        fastcgi_param SCRIPT_FILENAME $document_root/framework/main.php;
        fastcgi_param SCRIPT_NAME /framework/main.php;
        fastcgi_param QUERY_STRING url=$uri&$args;
    }

    location ~* \.php$ {
        fastcgi_keep_conn on;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_read_timeout 120;
        fastcgi_connect_timeout 60;
        fastcgi_send_timeout 120;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 65k;
        fastcgi_busy_buffers_size 128k;
    }

    # Deny access to silverstripe-cache
    location ~ ^/silverstripe-cache {
        deny all;
    }

    # Deny access to logs
    location ~ ^/logs {
        deny all;
    }

    # Don't execute scripts in the assets folder
    location ^~ /assets/ {
        sendfile on;
        try_files $uri $uri/ =404;
    }

    # Deny access to composer
    location ~ ^/(vendor|composer.json|composer.lock) {
        deny all;
    }

    # Deny access to yaml files
    location ~ \.yml$ {
        deny all;
    }

    # Deny access to template files
    location ~ \.ss$ {
        satisfy any;
        allow 127.0.0.1;
        deny all;
    }

    # CMS & Framework .htaccess rules
    location ~ ^/(cms|framework|mysite)/.*\.(php|php[345]|phtml|inc)$ {
        deny all;
    }
    location ~ ^/(cms|framework)/silverstripe_version$ {
        deny all;
    }
    location ~ ^/framework/.*(main|static-main|rpc|tiny_mce_gzip)\.php$ {
        allow all;
    }

    # Deny access to all dot files
    location ~ /\. {
        deny all;
    }

}

还有其他人有这个问题吗?

答案1

IRC 上的 #silverstripe 中的 Wmk 提出了禁用 GZIP 的解决方案:

将其放入“mysite/_config/config.yml” HtmlEditorField:use_gzip:false

并使用“?flush=all”刷新 Silverstripe 缓存。然后您就恢复了编辑器 :-)

相关内容