TinyMCE & Spellchecker & nginx 404 errors

Events happening in the community are now at Drupal community events on www.drupal.org.
ericrdb's picture

Hi All,

Running perusio's nginx config, I'm getting 404s when attempting to use the spellchecker plugin for TinyMCE, similar to this issue: http://drupal.org/node/986730

It looks like this snippet in drupal_boost_drush.conf is blocking the spellchecker:

location ~* ^.+\.php$ {
  return 404;
}

Not being a regex guru, I'm not sure how to accommodate the spellchecker's need to access:
YOURWEBSITE/sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/spellchecker/rpc.php

Can someone point me in the right direction? Thanks!

--
Eric DenBraber
www.mydbsolution.com

Comments

put another location directive below the first one

ppcc's picture

Hi

I think you can do this (and keep the config readable), by putting another location directive below the one you posted, using an = which has a higher precedence than ~*. (http://wiki.nginx.org/HttpCoreModule#location)

location = /sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/spellchecker/rpc.php {
try_files $uri;
}

or you could use ^~ to allow all the php scripts in that directory:

location ^~ /spellchecker/ {
  try_files $uri;
}

solved!

ericrdb's picture

Thanks for such a quick reply, I appreciate your help!

First, I added your second location statement and got an error when restarting nginx:

Restarting nginx: [emerg]: invalid number of arguments in "try_files" directive in /etc/nginx/sites-available/drupal_boost_drush.conf

I made a slight adjustment and the configuration file loaded:

location ^~ /spellchecker/ {
  try_files $uri @cache;
}

However, that got me 405 errors when I click on the spellcheck button. This directive works:

location ^~ /spellchecker/ {
  fastcgi_pass unix:/var/tmp/php5-fpm.sock;
}

I put this directive above the 404 refuse-all directive. Thanks again,

Yes

perusio's picture

This is a paranoid config. So every .php is enumerated. If you want to add another you must add it explicitly. I don't think you need another location. Comment out the /spellchecker location and try this:

location ~* ^/(?:index|boost_stats|rpc)\.php$ {
     fastcgi_pass unix:/var/tmp/php5-fpm.sock;
    # Filefield Upload progress
    # http://drupal.org/project/filefield_nginx_progress support
    # through the NgninxUploadProgress modules.
    track_uploads uploads 60s;
}

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: