Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is my nginx (1.1.19) conf for the Silverstripe site. I am using PHP-FPM as well. nginx and PHP-FPM for the most part are vanilla setups at the moment. I am using a separate FPM pool with its own unix socket.

server {
  root /srv/www/;

  index index.php index.html;

  access_log logs/;
  error_log logs/;

  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;

In the CMS it tries to load the Tiny MCE script (tiny_mce_gzip.php), it is a PHP script that is supposed to return JavaScript. It doesn't though and looks like it is just returning the PHP script as plain text. The request response is just the PHP text which causes the browser to fail because it is trying to interpret it as JavaScript (I think) and gives this error:

Uncaught SyntaxError: Unexpected token < 

The < seems to be the beginning of the opening <?php tag.

I must have something misconfigured for it to do this. Any suggestions? I can provide more info if needed.

share|improve this question
Your @silverstripe location looks very strange. SCRIPT_FILENAME, SCRIPT_NAME etc. seem to be completely wrong. Try setting it up according to the documentation. (Though it has some minor problems, it should at least be functional.) – Michael Hampton Dec 4 '12 at 20:00
@MichaelHampton I copied and pasted their config and now I just get a 404 when it tries to load the tiny_mce_gzip.php file. – Brandon Dec 4 '12 at 20:12


` # whitelist php files that are called directly and need to be interpreted 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;
share|improve this answer

Wmk in #silverstripe on IRC came with the solution to disable GZIP:

Put this in mysite/_config/config.yml

HtmlEditorField: use_gzip: false

And flush the Silverstripe cache with ?flush=all. And you've got your editor back :-)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.