这里是我的nginx(1.1.19)conf为Silverstripe网站。 我也在使用PHP-FPM。 nginx和PHP-FPM大部分是目前的香草设置。 我正在使用一个单独的FPM池与自己的Unixsockets。
server { server_name dev.example.com; root /srv/www/example.com/dev; index index.php index.html; access_log logs/dev.example.com.access.log; error_log logs/dev.example.com.error.log; location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm)$ { expires 7d; access_log off; access_log off; log_not_found off; } error_page 404 /framework/main.php; location / { try_files $uri @silverstripe; } location @silverstripe { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/framework/main.php; fastcgi_param SCRIPT_NAME /framework/main.php; fastcgi_param QUERY_STRING url=$uri&$args; fastcgi_buffer_size 32k; fastcgi_buffers 4 32k; fastcgi_busy_buffers_size 64k; fastcgi_pass unix:/var/run/php.fpm.example.sock; } }
在CMS中,它尝试加载Tiny MCE脚本( tiny_mce_gzip.php ),它是一个PHP脚本,应该返回JavaScript。 它不会看起来像只是以纯文本forms返回PHP脚本。 请求响应只是PHP文本,导致浏览器失败,因为它试图把它解释为JavaScript(我认为),并给出了这个错误:
Uncaught SyntaxError: Unexpected token <
<似乎是开始<?php标记的开始。
我必须有一些错误的configuration来做到这一点。 有什么build议么? 如果需要,我可以提供更多信息。
见https://gist.github.com/chtombleson/8703899
`#白名单直接调用并需要解释的php文件location = /framework/thirdparty/tinymce/tiny_mce_gzip.php {include fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; }
location = /framework/thirdparty/tinymce-spellchecker/rpc.php { include fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; }
IRC上的#silverstripe中的Wmk附带禁用GZIP的解决scheme:
把它放在mysite/_config/config.yml
HtmlEditorField: use_gzip: false
用?flush=all ”清空“银条”caching。 你已经得到了你的编辑器:-)